Fri, 23 Feb 2001 14:52:01 -0600
From: email@example.com [mailto:firstname.lastname@example.org]On Behalf Of
Sent: Friday, February 23, 2001 11:12 AM
Subject: [Tutor] modem
>Can someone tell me if there is a module that allows communication
>(read, write, enable and disable) to your serial port.
>Python 2.0 on windows 9X.
I've never tried it on windows, but the following works on linux. You might
want to try it, with the exception of the "/dev/cua0" as the modem device,
it shouldn't be specific to linux. Also, check the serial how-to and the
modem how-to at http://www.linuxdoc.org
I realize that's a linux site but I think there might still be some usefull
information there for you.
modem = open('/dev/cua0','w+') # replace /dev/cua0 with your modem device
# "AT" is part of an initialization string for your modem, check you modem's
x = os.read(modem.fileno(),200)
# You should get "OK" from this after sending "AT" with os.write. "200" is
# the maximum number of bytes to read, I just used 200 as an example.