Setting Up Autoreloading for iPython

August 28, 2013 — Leave a comment

If you have the latest version of iPython installed >=.12 , you can reload modules automatically.

# Run the commands below in the terminal
ipython profile create # tells you where config file is located

# edit the file with vim or nano
vim ~/.ipython/profile_default/ # The file location can be different
# Change the extensions and exec_lines to include autoreload
#c.InteractiveShellApp.extensions = []
c.InteractiveShellApp.extensions = ['autoreload']
#c.InteractiveShellApp.exec_lines = []
c.InteractiveShellApp.exec_lines = ['%autoreload 2']

Now if you make edits in your code, it should reload the modules. In a testing environment, this is great, but I suggest that you do not do it in a production environment.


Posts Twitter Facebook

My name is Michael Le, and I am a web developer.

No Comments

Be the first to start the conversation.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.