Read/write seriel?

simon place simon_place at
Mon Feb 17 01:58:40 CET 2003

> claus
> You don't say which OS you use.  The answer is different for each:
> Linux:
>     ser=open("/dev/cua0","r") # depends on distro, could be e.g. ttyS0 
>     Try 'man -k serial'
> Windows
>     ser=open("com1","r")
> Other OSes will differ significantly, and many restrict access to such devices 
> for security reasons.  Try googling for your OS + serial...
> Happy hunting, 
> -andyj
> On Monday 03 Feb 2003 1:51 pm, Claus Hemdrup wrote:

don't think this works, how would python know you didn't want a file 
called "com1" (windows).

On windows for a serial you normally suffix a colon, which would be very 
nice if it worked ( it does in the windows kernel32 ) but i think you 
need a library ( several avilable ) you see i think there might be setup 
differencies between systems as well as addressing.

I've been thinking about a proxy server that maps a socket to a local 
serial port ( terminology betrays the common heritage ) there are 
commercial examples of this around. Ideally you just need the one for 
your system, it sort of acts like a high level driver using socket comms 
as the known bridge.


More information about the Python-list mailing list