Is there a GUI for IPython that allows me to open/run/edit Python files? My way of working in IDLE is to have two windows open: the shell and a .py file. I edit the .py file, run it, and interact with the results in the shell.
Is it possible to use IPython like this? Or is there an alternative way of working?
When I’m working with python, I usually have two terminal windows open – one with IPython, and the other with a fairly customized Vim.
Two good resources:
Though it sounds like what you want is IPython’s magic function
%ed/%edit:An example of what you can do:
In the file I put:
After saving and quitting the file:
You can define functions or anything else – just remember that the contents of the file will be executed when you close it.
Another similar workflow is to
cdto the directory containing your Python script that you’re editing with your favorite editor. Then you can%runthe script from within IPython and you’ll have access to everything defined in the file. For instance, if you have the following in the filetest.pyin your/home/myselfdirectory:Then you can do the following:
Either a mix or one of those workflows should give you something very similar to the way you’re used to working in IDLE.