How to reimport an updated package while in Python Interpreter

0 votes

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?

May 11, 2020 in Python by kartik
• 37,530 points
647 views

You can use importlib.reload() for the same.

1 answer to this question.

0 votes

Hello,

To import an updated package while in Python Interpreter you have two method:

Method-1:

try using reimport: a full featured reload for Python.

Method-2:

It looks like this question was asked/answered prior to the release of reimport, which bills itself as a "full featured reload for Python":

Thank You!!

answered May 12, 2020 by Niroj
• 82,880 points

Related Questions In Python

+4 votes
7 answers
+1 vote
1 answer

How to print an error in Python?

For Python 2.6 and later and Python ...READ MORE

answered Aug 23, 2018 in Python by Priyaj
• 58,140 points
792 views
0 votes
3 answers

how to exit a python script in an if statement

In Python, the break statement provides you with the opportunity ...READ MORE

answered Dec 14, 2020 in Python by Roshni
• 10,480 points
144,616 views
0 votes
1 answer

How to correctly return an a dictionary as an output in zappier code using python?

David here, from the Zapier Platform team. ...READ MORE

answered Dec 3, 2018 in Python by charlie_brown
• 7,780 points
678 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 2,475 views
0 votes
1 answer
0 votes
1 answer

How to print an exception in Python?

Hello @kartik, For Python 2.6 and later and ...READ MORE

answered Dec 7, 2020 in Python by Niroj
• 82,880 points
105 views
0 votes
1 answer

How to get an absolute file path in Python?

Hello @kartik, Try this out: >>> import os >>> os.path.abspath("mydir/myfile.txt") 'C:/example/cwd/mydir/myfile.txt' Also ...READ MORE

answered Dec 7, 2020 in Python by Niroj
• 82,880 points
174 views