Comunicating through COM ports

David Mallwitz dmallwitz at cox.rr.com
Sat Dec 22 00:41:17 EST 2001


FW: Comunicating through COM ports

    Ah, ok. Two possibilities here - 1) download a Python distro that has
the Serial package already incorporated (I know Activestate comes with it,
not sure about PythonWare) or 2) figure out how to make the Serial module
work with the plain vanilla Python install from python.org.
    Since 2.2 was just released I downloaded it from python.org and
installed, then copied the Serial package over to libs/site-packages. This
imports the Serial module just fine, but fails on the 'Serial.Serial'
function apparently because 'elapsedTimer' can't be found. I'm guessing that
it's just a PYTHONPATH issue, but I don't have time to work through it right
now. I'll post the Serial module if you want to try the second option, but
the fastest/easiest choice would be to download the Activestate distro
(www.activestate.com). On the other hand, I'm kind of down on Activestate
right now since the lastest release of their IDE 'Komodo' won't honor my
home-user license so maybe it's time to give PythonWare a try
(www.pythonware.com).

Best,
Dave

"Alves, Carlos Alberto - Coelce" <calves at coelce.com.br> wrote in message
news:mailman.1008962966.22789.python-list at python.org...
I'm using Python 2.1 and I installed it through .exe installer from
www.python.org
-----Original Message-----
From: David Mallwitz [mailto:dmallwitz at cox.rr.com]
Sent: Friday, December 21, 2001 4:12 PM
To: python-list at python.org
Subject: Re: Comunicating through COM ports


FW: Comunicating through COM portsWhich Python distribution are you using?
Or did you compile from source?
Dave
"Alves, Carlos Alberto - Coelce" <calves at coelce.com.br> wrote in message
news:mailman.1008955468.30561.python-list at python.org...
Sorry, but as I said before, I'm under windows98 and I haven't such
directory.
Do I need to download that module from anywhere?!If so, give me an URL.


-----Original Message-----
From: David Lees [mailto:deblnonospammyno at raqia.com]
Sent: Friday, December 21, 2001 1:46 PM
To: python-list at python.org
Subject: Re: FW: Comunicating through COM ports


Python21/scripts/PythonSerial
david lees


> "Alves, Carlos Alberto - Coelce" wrote:
>
> Thanks for the example. But, where can I find such module Serial?!
>
> -----Original Message-----
> From: David Mallwitz [mailto:dmallwitz at cox.rr.com]
> Sent: Thursday, December 20, 2001 10:26 PM
> To: python-list at python.org
> Subject: Re: Comunicating through COM ports
>
> Comunicating through COM portsChapter 19 of Mark Hammond and Andy
> Robinson's
> 'Python Programmingon on Win32' covers this quit well, and with the
> Activestate Python distro there is a multithreaded demo called
> 'win32comport_demo.py'. But here's what I do - example is from a
> console
> connection to an old Cisco router.
>
> >>> from Serial import Serial
> >>> ### open the COM1 port
> >>> serialconfig = Serial.PortDict()
> >>> serialconfig['port'] = Serial.COM1
> >>> serialconfig['rxBufSize'] = 4096
> >>> port = Serial.Port(serialconfig)
> >>> port.open()
> >>> port.write('show conf \r')
> >>> x = port.read()
> >>> x
> 'show conf \r\nUsing 768 out of 32762 bytes\r\n!\r\nversion 11.1\r\nno
>
> service u
> dp-small-servers\r\nno service tcp-small-servers\r\n!\r\nhostname
> Router\r\n!\r\
> n!\r\nip subnet-zero\r\nno ip domain-lookup\r\n!\r\nhub ether 0 1\r\n
> link-test\
> r\n auto-polarity\r\n!\r\nhub ether 0 2\r\n link-test\r\n
> auto-polarity\r\n!\r\n
> hub ether 0 3\r\n link-test\r\n auto-polarity\r\n --More-- '
>
> Best,
> Dave
>
> "Alves, Carlos Alberto - Coelce" <calves at coelce.com.br> wrote in
> message
> news:mailman.1008852145.28654.python-list at python.org...
> Anybody could give me an example code of how connect/comunicate
> through COM
> ports (i.e. COM1, COM2). I'm under windows 98.
> Thanks!!!
> Carlos Alberto
> COELCE/DPRON-Departamento de Projetos e Obras Norte
> Fone: 677- 2228
> e-mail: calves at coelce.com.br
> \|||/
> (o o)
> --ooo0-(_)-0ooo--
>
> -----=  Posted via Newsfeeds.Com, Uncensored Usenet News  =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
>  Check out our new Unlimited Server. No Download or Time Limits!
> -----==  Over 80,000 Newsgroups - 19 Different Servers!  ==-----
> --
> http://mail.python.org/mailman/listinfo/python-list
--
debl
--
http://mail.python.org/mailman/listinfo/python-list




-----=  Posted via Newsfeeds.Com, Uncensored Usenet News  =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
 Check out our new Unlimited Server. No Download or Time Limits!
-----==  Over 80,000 Newsgroups - 19 Different Servers!  ==-----
--
http://mail.python.org/mailman/listinfo/python-list




-----=  Posted via Newsfeeds.Com, Uncensored Usenet News  =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
 Check out our new Unlimited Server. No Download or Time Limits!
-----==  Over 80,000 Newsgroups - 19 Different Servers!  ==-----



More information about the Python-list mailing list