I only know the module name during runtime, and as such this is how it looks like:-
a = 'mymodule'
__import__(a)
but along the way, when mymodule.py is changed, i wanna reload it again.
is there a command like
__reload__(a)
?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes. It’s
reload(module). See the python modules documentation (section 6.1) and the library builtin functions reference.The argument is a module object, not a string so you must import it first.