Re: How to read from serial port?

2016-04-26 Thread Ben Finney
Gonzalo V writes: > Try print('blaba'+str(out)) I doubt that gives the desired result for a bytes object. Did you try it? >>> foo = b'\xde\xad\xbe\xef' >>> str(foo) "b'\\xde\\xad\\xbe\\xef'" >>> print(str(foo)) b'\xde\xad\xbe\xef' Yes, the “b'” and backslashes are all part

Re: How to read from serial port?

2016-04-26 Thread Gonzalo V
Try print('blaba'+str(out)) saludos, desde un móvil. El abr 26, 2016 2:33 p.m., "Grant Edwards" escribió: > On 2016-04-26, David Aldrich wrote: > > > #!/usr/bin/python3 > > import serial > > > > ser=serial.Serial('COM1',115200) > > while True: > > out = ser.read() > > print('Receiving..

Re: How to read from serial port?

2016-04-26 Thread Grant Edwards
On 2016-04-26, David Aldrich wrote: > #!/usr/bin/python3 > import serial > > ser=serial.Serial('COM1',115200) > while True: > out = ser.read() > print('Receiving...'+out) > > When I run it and send data for it to read I get: > Traceback (most recent call last): > File "serial_read.py",

Re: How to read from serial port?

2016-04-26 Thread Peter Otten
David Aldrich wrote: > Hi > > I have written a very simple program to read and print data from the > serial port using pyserial: > > #!/usr/bin/python3 > import serial > > ser=serial.Serial('COM1',115200) > while True: > out = ser.read() > print('Receiving...'+out) > > When I run it an

How to read from serial port?

2016-04-26 Thread David Aldrich
Hi I have written a very simple program to read and print data from the serial port using pyserial: #!/usr/bin/python3 import serial ser=serial.Serial('COM1',115200) while True: out = ser.read() print('Receiving...'+out) When I run it and send data for it to read I get: C:\SVNProj\Rag

Re: Read from serial port

2008-08-14 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: I need a promt/terminal when the device is connected to PC. If user enters a command by serial port and press "Enter" then the data is read by the device and work on the command. This is similar to readline() function. Unfortunately there is no readline() function for GM

Re: Read from serial port

2008-08-14 Thread binaryjesus
On Aug 14, 6:11 am, [EMAIL PROTECTED] wrote: > Hi, > I am newbie in python. I am working on Telit GM862 GPS/GPRS module > which has python interpreter built in. But it seems this problem is > pretty much related to general python structure. > > I need a promt/terminal when the device is connected t

Read from serial port

2008-08-13 Thread mmrasheed
Hi, I am newbie in python. I am working on Telit GM862 GPS/GPRS module which has python interpreter built in. But it seems this problem is pretty much related to general python structure. I need a promt/terminal when the device is connected to PC. If user enters a command by serial port and press

Re: Read from Serial Port

2006-01-23 Thread Neil Benn
Casey Bralla wrote: >I'd like to read ASCII data from a serial port, but (once again) I'm having >trouble getting started. (Can't seem to find the basic level of docs to >get going ) > >I'd like to use only standard "built-in" modules if possible. > >Could somebody offer a simple code-snippet to

Re: Read from Serial Port

2006-01-21 Thread Grant Edwards
On 2006-01-21, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: >> appropriate platform-specific code. I'll be happy to answer >> questions about the Posix parts of it, but I had the portion of >> my brain containing Win32 knowledge cauterized. > > I'm working on that. Last time I checked there was eve

Re: Read from Serial Port

2006-01-21 Thread Runsun Pan
How about reading from the USB ports ?-- ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~Runsun Pan, PhD[EMAIL PROTECTED]Nat'l Center for Macromolecular Imaging http://ncmi.bcm.tmc.edu/ncmi/~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Read from Serial Port

2006-01-21 Thread Peter Hansen
Grant Edwards wrote: > On 2006-01-21, Casey Bralla <[EMAIL PROTECTED]> wrote: >>I'd like to use only standard "built-in" modules if possible. > > Then there aren't going to be any "basic level docs" because > it's just not an easy thing to do. You pretty much have to do > exactly what you would d

Re: Read from Serial Port

2006-01-21 Thread Diez B. Roggisch
> appropriate platform-specific code. I'll be happy to answer > questions about the Posix parts of it, but I had the portion of > my brain containing Win32 knowledge cauterized. I'm working on that. Last time I checked there was even some AMIGA pre-AGA-stuff in there. Which I actually think is c

Re: Read from Serial Port

2006-01-20 Thread Grant Edwards
On 2006-01-21, Casey Bralla <[EMAIL PROTECTED]> wrote: > I'd like to read ASCII data from a serial port, but (once > again) I'm having trouble getting started. (Can't seem to > find the basic level of docs to get going ) > > I'd like to use only standard "built-in" modules if possible. Then ther

Re: Read from Serial Port

2006-01-20 Thread Steve Holden
Casey Bralla wrote: > I'd like to read ASCII data from a serial port, but (once again) I'm having > trouble getting started. (Can't seem to find the basic level of docs to > get going ) > > I'd like to use only standard "built-in" modules if possible. > > Could somebody offer a simple code-snipp

Read from Serial Port

2006-01-20 Thread Casey Bralla
I'd like to read ASCII data from a serial port, but (once again) I'm having trouble getting started. (Can't seem to find the basic level of docs to get going ) I'd like to use only standard "built-in" modules if possible. Could somebody offer a simple code-snippet to get me started reading from