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,520 points
2,520 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,100 points
1,419 views
+1 vote
5 answers

how to exit a python script in an if statement

Instead of using the normal UTF-8 encoding, ...READ MORE

answered Jul 4, 2023 in Python by bodymist
• 140 points
355,079 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,720 points
1,616 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 4,397 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
640 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
796 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP