SERIAL I/O ON WIN32

Darrell news at dorb.com
Sun Jan 16 15:33:37 EST 2000


Haven't messed with the serial-i/o module but did this little experiment to
dial my modem using COM. Mscomm32 came from me running makepy.py on
Mscomm32, I don't recall the exact syntax. The hard part was figuring out
how to use it from digging though Microsoft web sites and books.

import Mscomm32, os

c=Mscomm32.MSComm()
print dir(c)
c.CommPort = 1
c.Settings = "115200,N,8,1"
c.PortOpen = 1
c.InputLen=0
c.Handshaking=2
c.RTSEnable=1
print 'Event:', c.CommEvent
c.Output="ATDT555-1234" + chr(13)+'\n\n'
print 'OutBufferCount:',c.OutBufferCount
print 'Event:', c.CommEvent
while 1:
    buf=raw_input('')+'\n'
    c.Output=buf
    if c.InBufferCount > 0:
        print 'INPUT:',c.Input
    print 'Event:', c.CommEvent

c.PortOpen = 0
raw_input('Wait')

--
--Darrell
"bob" <bob at no.com> wrote in message news:Qvpg4.581$253.12322 at news...
> Hi there...newbie to Python here.
>
> I need to pass information across a COM port. I have the serial-i/o module
> but no clue on how to use it.
>
> Thanks for any and all help!
>
> Bob
>
>
> --
> http://www.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list