Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (47.6k points)

I often test my module in the Python Interpreter, and when I see an error, I quickly update the .py file. But how do I make it reflect on the Interpreter? So, far I have been exiting and reentering the Interpreter because re-importing the file again is not working for me.

1 Answer

0 votes
by (106k points)

For re-importing an updated package in Python interpreter you can use the following mentioned way:-

If you are using Python3.4 you can use the importlib.reload(packagename) method and it will do the task. For Python3 you can use imp.reload(packagename)

Related questions

0 votes
1 answer
asked Jul 29, 2019 in Python by Rajesh Malhotra (19.9k points)
0 votes
1 answer
asked May 11, 2020 in Python by Sudhir_1997 (55.6k points)

Browse Categories

...