Re: re-importing modules



On Apr 30, 12:49 pm, "T. Crane" <tcr...@xxxxxxxxxxxxxxxxxx> wrote:
Hi,

When troubleshooting code that's saved in a text file, I often find that I
want to make a change to it, re-save it, then reimport it. However, just
typing

import myTestCode

doesn't always seem to import the newer version. Is it supposed to? I find
that right now I often have to close my iPython window, then reopen it and
import my recently modified code. I know this can't be the best way to do
this, but I don't know what is.

any suggestions/help welcome and appreciated,
trevis

Hi,

Another person posted the same thing today. As with that person, you
probably need to use the reload() function. See this post for more
details:

http://www.python.org/search/hypermail/python-1993/0342.html

Mike

.



Relevant Pages

  • Re: re-importing modules
    ... When troubleshooting code that's saved in a text file, ... want to make a change to it, re-save it, then reimport it. ... In addition to the warning that reload() does not recursively reload ...
    (comp.lang.python)
  • re-importing modules
    ... When troubleshooting code that's saved in a text file, ... want to make a change to it, re-save it, then reimport it. ...
    (comp.lang.python)