faqts : Computers : Programming : Languages : Python : Common Problems : PythonWin

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

1 of 2 people (50%) answered Yes
Recently 1 of 2 people (50%) answered Yes

Entry

Is there anyway by which the changes made to the saved script can be reflected in the interactive??

Oct 20th, 2004 05:18
Michael Chermside, subha fernando,


[Partial Answer]
I don't know specifically about PythonWin, but in the interactive editor
this can be achieved by using the built-in function reload(). It works
something like this:
    >>> import my_module
    >>> # now go edit my_module before continuing
    >>> reload(my_module)
    <module 'my_module' from 'C:\PythonScripts\my_module.py'>
Only the one module that is reloaded will be changed, so if one module
depends on another then this approach is not quite enough. IDLE handles
that problem by providing a menu command that will reload ALL modules
loaded so far. I'm not sure what PythonWin does.
-- Michael Chermside