Am 25.04.2011 14:46, schrieb rjmccorkle:
hi - I need to open a serial port in 9600 and send a command followed
by closing it, open serial port again and send a second command at
115200.  I have both commands working separately from the python
command line but it won't work in the script.  Any idea why?

What does "won't work" mean? I can't see any issues in the code.

I suppose the string sent with 9600 tells the device to change the speed. Are you sure that it is received correctly?

Additionally, maybe you have output issues. E.g. you just write "ser.baudrate" instead of "print ser.baudrate", so that could be a source of behavioral differences.


#import os
#program = 'C:\Program Files\Program.exe'+'-start'
#os.system(r'program)

I suppose this doesn't belong to the problem?


Thomas

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to