howto reload Python module?

D

dmitrey

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.
 
D

Diez B. Roggisch

dmitrey said:
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
 
S

Steven D'Aprano

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
DewittMill
Top