[Python-au] pythonwin and reloading modules

Mark Hammond mhammond at skippinet.com.au
Fri Jun 18 00:56:15 CEST 2004

Pythonwin runs all code in the same process - so even when you hit "run"
multiple times, some things only happen once.

You want to see the reload() statement - (And Ctrl+I in Pythonwin) this
re-imports a modified module.  Note however that isclass instances still
exist when you do the reload, those existing instance will *not* see the
changes.  Any new instances created will.


> -----Original Message-----
> From: python-au-bounces at python.net
> [mailto:python-au-bounces at python.net]On Behalf Of vector180
> Sent: Friday, 18 June 2004 8:20 AM
> To: python-au at python.net
> Subject: [Python-au] pythonwin and reloading modules
> Hi all
> Fairly new to python and pythonwin.
> Im working on a tool where a python script builds a text file from
> various classes imported from  picswitch.py
> I modify picswitch.py save it and then run the
> sio_menu_builder.py which
> imports picswitch.py. Problem is when using pythonwin the previous
> modules or classes within them remains "in memory"?
> ie if i delete a class out of picswitch.py and rerun builder the text
> file output echos the fact that the class is still there!.If
> i shutdown
> pythonwin and reopen and rerun builder, only then does it
> correctly echo
> the deletion.
> source is at
> http://mec-symonds.eng.monash.edu.au/cgi-bin/twiki/view/Saqqar
excuse the bad python and lack of documentation :)

I am unsure as to wether this is a misunderstanding of python or
pythonwin, on my behalf.
As I am constantly modifing picswitch and rebuilding, its very annoying
to have to close pythonwin each time.I use pythonwin mostly because when
Im editing picswitch.py i like the way i can collapse/expand the classes
making it easier to read.
I possibly could have a dos window open in that dir and use pythonwin to
edit but actually run the build from dos. Im just making sure Im not
missing something first.

python-au maillist  -  python-au at starship.python.net

More information about the python-au mailing list