[Tutor] Locating Serial module

Yigal Duppen yduppen at xs4all.nl
Wed Aug 27 18:43:12 EDT 2003


> 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



More information about the Tutor mailing list