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 ?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…