import a modified module

David MacQuigg dmq at gain.com
Fri Mar 26 13:15:57 EST 2004


On Thu, 25 Mar 2004 20:38:00 -0700, Ken Godee <ken at perfect-image.com>
wrote:

>myang wrote:
>> I am revising a python module, and try it in python shell. Each time after
>> the module is modified, how can I import the new module? I remember there is
>> an "import" like staff to do it, but dont know its name clearly. I was not
>> able to google out it, and the huge bulk of python documentation is
>> fearsome. :(

I've found the best intro is the Python Tutorial at
http://python.org/doc/current/tut/tut.html

Then, if you want a more thorough introduction, I would recommend
Learning Python, 2nd ed., Mark Lutz & David Ascher.


>you want to reload the modified module without
>exiting the interpiter?
>
>if so try
>
>reload(mymod)

The docs on reload are a little confusing.  I've written a piece at
http://ece.arizona.edu/~edatools/Python/Reload.htm

Your comments are welcome.

-- Dave




More information about the Python-list mailing list