Python: update a script .py file after edit

import hoge
# edit the hoge.py
reload(hoge)

You might have an experience that iPython/Anaconda seems to ignore your update on a script file. No matter how many times you edited and saved, iPython/Anaconda returns same error message as you don’t update anything at all. The solution is to call reload function that recompiles the module.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s