Re: [web2py] Re: please help: owned by windows way of doing things
I just got around to responding...I was going to suggest PySerial, as I use that to communicate with an attached piece of hardware. Seems to work well cross-platform.
Re: [web2py] Re: please help: owned by windows way of doing things
for the record, I solved this using PySerial
[web2py] Re: please help: owned by windows way of doing things
In UNIX for text mode output the default setting in the serial driver is to map the standard UNIX EOL which is \n to \r\n Unix input also maps \r to \n The Linux man page is man 4 tty_ioctl for more than you will likely will want to know In Windows the file must contain the \r\n which is the standard EOL sequence for that system. This is why programs such as ftp in ascii transfer mode do the conversion for you. The Linux mcopy program from Mtools might help you otherwise (part of my Ubuntu install)
[web2py] Re: please help: owned by windows way of doing things
I think in Linux, line breaks are just a single \n character, but in windows, it's supposed to be \r\n. You might need to replace all \n's with \r\n's. On Saturday, April 9, 2011 1:15:55 PM UTC-4, w2padawan wrote: hello everybody, sorry if this a too basic question, but have not found anything about how to solve this. I'm trying to print some text to a serial printer directly from my controller just pushing the text to /dev/ttyS0 with Popen. that works in gnulinux but in win32 it doesn't work if the text has line breaks. even, if I write a text with line breaks, doing a type asdf.txt com1 print all the text in one line. in short, how could I [format the text to] print new lines in windows to a serial printer? best regards, danto