[Tutor] Locating Serial module

Stanfield, Vicki {D167~Indianapolis} VICKI.STANFIELD at ROCHE.COM
Wed Aug 27 12:58:16 EDT 2003


Okay. Thanks. I got back the following:

<module 'serial' from 'C:\Python22\lib\site-packages\serial\__init__.pyc'>

so I guess that means that I am using serial via the init under that directory instead of any of the 4 serial.py files on my system. No wonder I couldn't find it. 

Thanks.
--vicki


-----Original Message-----
From: Yigal Duppen [mailto:yduppen at xs4all.nl]
Sent: Wednesday, August 27, 2003 10:43 AM
To: tutor at python.org
Subject: Re: [Tutor] Locating Serial module


> Doesn't this mean that there should be a serial.py file on my system
> which contains a function Serial?

That, or a file called serial.pyc (compiled).

But using the interpreter, you can see directly where a module comes from:

Python 2.2.2 (#1, Mar 17 2003, 15:17:58)
[GCC 3.3 20030226 (prerelease) (SuSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys
<module 'sys' (built-in)>
>>> import types;
>>> types
<module 'types' from '/usr/lib/python2.2/types.pyc'>
>>>

So in your case, "import serial", followed by "serial" might do the trick.

Regards,
YDD

_______________________________________________
Tutor maillist  -  Tutor at python.org
http://mail.python.org/mailman/listinfo/tutor



More information about the Tutor mailing list