Reloading modules into interpreter

Mats Wichmann mats at laplaza.org
Wed Aug 15 06:54:32 EDT 2001


On Sun, 12 Aug 2001 11:53:32 +0200, "Alex Martelli"
<aleaxit at yahoo.com> wrote:

:"jsnyder" <trelis at mindspring.com> wrote in message
:news:9l4ge0$m0q$1 at slb7.atl.mindspring.net...
:> > But there's more!  If when you click this toolbar-button the current
:> > MDI child-window in Pythonwin is one with a module being edited,
:> > you don't even have the bother of the file-selection box -- it knows
:> > the module you want to import or reload is specifically the one
:> > in the current MDI child-window.  Nice, isn't it?-)
:    ...
:> I'm using IDLE v0.8 and there are no icons.  Are we referring to the same
:> thing?
:
:Of course not!  You originally said:
:
:>>> Running from Pythonwin, I am importing a module and then calling its
:method.
:
:If you're using IDLE, you're not "running from Pythonwin"... Pythonwin
:is a different IDE from IDLE!
:
:In IDLE, like in the text-mode Python interpreter, you have to use
:the built-in function "reload(mymodule)" at the prompt.  Pythonwin
:is niftier in this respect (I don't know if idle-fork has enhanced
:this little but important detail).

Press F5 with the editor window selected.  Imports the module
currently being edited; reloads it if it's already been imported.

(Not an idle-fork enhancement, it's been there as long as I remember,
which isn't that far back...)



More information about the Python-list mailing list