Refreshing imported modules

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • noagbodjivictor@gmail.com

    #1

    Refreshing imported modules

    I have the python interperter opened while editing a module. The
    problem is that when I make changes, the module is not refreshed
    whenever I import it again. I have to re-launch the interpreter, is
    there a way to shortcut this?

  • sykora

    #2
    Re: Refreshing imported modules

    On May 2, 7:24 pm, noagbodjivic... @gmail.com wrote:
    I have the python interperter opened while editing a module. The
    problem is that when I make changes, the module is not refreshed
    whenever I import it again. I have to re-launch the interpreter, is
    there a way to shortcut this?
    I believe you can use the 'reload' command. ie

    First import your module :
    >>import module_name

    If you want to refresh the module after having changed it,
    >>module_name = reload(module_n ame)
    That should work. However, any variables you have declared which arise
    from classes within your module must be redeclared.

    Comment

    Working...