howto reload Python module?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dmitrey

    #1

    howto reload Python module?

    my Python module was changed in HDD (hardware disk drive), moreover,
    changed its location (but still present in sys.path).
    how can I reload a func "myfunc" from the module? (or howto reload
    whole module)?
    Thank you in advance, D.

  • Diez B. Roggisch

    #2
    Re: howto reload Python module?

    dmitrey schrieb:
    my Python module was changed in HDD (hardware disk drive), moreover,
    changed its location (but still present in sys.path).
    how can I reload a func "myfunc" from the module? (or howto reload
    whole module)?
    Thank you in advance, D.
    By using *drumroll* the reload function!

    diez

    Comment

    • Steven D'Aprano

      #3
      Re: howto reload Python module?

      On Sun, 02 Sep 2007 13:28:26 -0700, dmitrey wrote:
      my Python module was changed in HDD (hardware disk drive), moreover,
      changed its location (but still present in sys.path). how can I reload a
      func "myfunc" from the module? (or howto reload whole module)?
      Thank you in advance, D.
      You're moving the LOCATION of modules while they are running???

      WHY???

      Nevertheless, and much to my surprise, a quick test suggests that so long
      as the new location is in sys.path, reload() continues to do what it is
      supposed to do.


      --
      Steven.

      Comment

      Working...