SecureCRT脚本(Python)中怎么获取串口发送命令的返回值?
高洛峰
高洛峰 2017-04-17 11:28:57
0
2
757

使用SecureCRT连接串口,现需要使用脚本自动发送命令,但需要获取到所发命令的返回值,请问有什么方法可以实现? 在SecureCRT官网上有Python脚本的例子:http://www.vandyke.com/support/securecrt/scripts/getdata.py.txt 我按例子做了之后,并不能得到相应的结果。 promptString = "linux$" crt.Screen.WaitForString(promptString) 这两行代码过不去,应该是promptString这个值设置的有问题,请帮忙解决,谢谢。

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(2)
洪涛

It’s better to answer your own questions! I once asked this question entirely because I was not familiar with SecureCRT scripts, so I asked such a relatively low-level question. It seems now that I just didn't understand the variable PromptSrting at that time, so I couldn't get the desired results. Because the PromptSrting of the system I am using does not start with linux$, I cannot completely copy the example. Now after modifying this variable, everything is OK.

Peter_Zhu

Have you tried using python to connect to the linux serial port via ssh?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template