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 in Python by kartik
• 11,890 points
34 views

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 11 by Niroj
• 23,950 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
• 57,530 points
556 views
0 votes
1 answer

how to exit a python script in an if statement

This works fine for me: while True: ...READ MORE

answered Sep 19, 2018 in Python by bug_seeker
• 15,390 points
17,380 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,760 points
230 views
+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 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 963 views
0 votes
0 answers
0 votes
1 answer

How to create a zip archive of a directory in Python?

Hello @kartik, The easiest way is to use shutil.make_archive. ...READ MORE

answered May 11 in Python by Niroj
• 23,950 points
18 views
0 votes
1 answer

How to get the latest file in a folder using python?

Hello @kartik,  would suggest using glob.iglob() instead of the glob.glob(), as ...READ MORE

answered May 27 in Python by Niroj
• 23,950 points
25 views