Reloading modules

richard_chamberlain richard_chamberlain at ntlworld.com
Sun Jun 25 12:20:23 EDT 2000


Hi Duncan,

To reload something you need to have imported it in the first place. You've
not imported the module you've import the contents of the module. You could
probably do something like:

import Graph
reload(Graph)
from Graph import *

or go the more sensible route and use import Graph to begin with.

Richard


Duncan Smith <buzzard at urubu.freeserve.co.uk> wrote in message
news:8j5atk$ijs$1 at newsg4.svr.pol.co.uk...
> >>> from Graph import *
> .
> .
> .
> >>> reload(Graph)
> Traceback (innermost last):
>   File "<interactive input>", line 1, in ?
> TypeError: reload() argument must be module
>
> What do I need to do to successfully reload a module?  I'm currently
wasting
> a lot of time re-starting PythonWin each time I want to test a changed
> module and I can't find the answer.  Thanks
>
> Duncan
>
>





More information about the Python-list mailing list