Re-running script from Tk shell

kyosohma at gmail.com kyosohma at gmail.com
Mon Apr 30 19:29:49 CEST 2007


On Apr 30, 9:51 am, gtb <goodTweetieB... at hotmail.com> wrote:
> I am testing a simple script by running it in the Tk shell. It imports
> a class from another module. I edit and save the file from which I
> import. When I want to re-run I delete the Tk window  and run the
> module from the Edit window (F5 - Run Module). The script that does
> the importing does not see the changes to the imported class, even if
> I delete the compiled files. For it to see the changes I must close
> all the edit windows and re-open an Idle edit.
>
> Perhaps I need to de-import the class, but I have not found a method
> in the tutorial or the reference (yet).
>
> Thanks

You probably need to reload() the imported module. Check out the
following thread: http://www.python.org/search/hypermail/python-1993/0342.html

Hopefully that's what you meant anyway.

Mike




More information about the Python-list mailing list