how does the main module notice when I change a module

John Roth newsgroups at jhrothjr.com
Sat Aug 16 02:37:14 CEST 2003


"Irmen de Jong" <irmen at -NOSPAM-REMOVETHIS-xs4all.nl> wrote in message
news:3f3d4cca$0$49103$e4fe514c at news.xs4all.nl...
> Marcus Schneider wrote:
>
> > I use PythonWin on WinXP. Every time I change a module, I have to
> > leave PythonWin and re enter to make it notice I have made changes. I
> > guess this is not the normal way to do that.. do I have to store the
> > module at a specific place? Is there a kind of "reset" command to make
> > the main module update specific data?
>
> Doesn't "reload(MyModule)" work?
> Type it at the interactive prompt.

Sometimes it does, sometimes it doesn't. It depends on exactly how your
application is configured, and the last thing I want to do is switch to the
command screen to type something in to run a test, and then have to run
the test as well. Extra work is, well, extra work.

Frankly, I gave up trying to test directly under PythonWin a long time
ago. Now, I just use it for editing, and keep a command window open
for testing. I've got a script for each test module (I use unittest in true
XP test first fashion), and it's almost as fast to switch to the command
window and enter two characters and a return as it would be to make
sure the correct file is selected, go to the menu, select test and
hit enter.

I've heard rumblings that the latest version of Idle (the one shipped
with 2.3) runs your tests in a separate process so this problem doesn't
happen. However, I haven't installed 2.3 yet to check it out. It might
be time to check out Idle if it does indeed create a new process for
each test.

John Roth

>
> --Irmen
>






More information about the Python-list mailing list