Without disrupting or restarting the Python server The module needs to be updated.
If mymodule.py changes
unimport mymodule
import mymodule
Or
If mymodule.py changes
reimport mymodule
Is there a way to unimport/reimport modules in this way?
python moduke reload python-import
Write reload()
to reload modules that have already been imported
import mymodule
while True:
# a matter of business
if is_changed(mymodule): #Detect that the module has changed -> See the link below the post
mymodule = reload(mymodule)
To create a if_changed()
function:
I want to find out where the module is (path)Please refer to
© 2024 OneMinuteCode. All rights reserved.