Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
200 views
in Technique[技术] by (71.8m points)

python - Pyserial difference between shell and script

I am writing a set of interface python classes to command several devices via serial communication. In this case I am trying to pilot an Agilent signal generator via RS232. The communication of the classes is based on pyserial, written in python3 and used on a Linux OS. The problem I have is the following: when I try to set the period of a burst using by writing the appropriate command in a python script and then running the script, the signal generator raises an error. On the other hand if I give the exact same command in a live python shell it works perfectly. I was thinking it could be due to the differences between using a shell or a script which i am not very familiar with. Does anyone know how to fix the problem ?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...