Why IPy: reasons for using IPython interactively
52 points by ZygmuntZ 11 years ago | 15 comments- paulgb 11 years agoIPython's built-in notebook mode (ipython notebook) entirely changed how I use Python. It's like an interactive session you can go save, reproduce, and publish.
- Derbasti 11 years agoYes, and a hundred times yes for teaching.
- Derbasti 11 years ago
- matmann2001 11 years agoIPython is great, but that was the most unconvincing article I've ever read.
- doug1001 11 years agoi've been a moderate fan of ipython; it's the ipython notebook that changed everything for me.
i can have everything inline: syntax-highlignted code, markdown, dynamic plots, and LaTeX equations.
(some examples: http://nbviewer.ipython.org/github/ipython/ipython/blob/mast...)
what's more, you can share you work as a static .ipynb document or dynamically via a server (rather than your localhost, which is the default).
- alexberghage 11 years agoThe shell exec magic, especially when combined with notebook mode and pylab inline, can make some simple analyses of text data really dead simple. You can, for example, do something like:
Which will dump out a nice pretty 12-bin histogram of whatever the numeric data in the third column of output, of messages containing interesting_event was. To get this sort of fancy, run `ipython notebook --pylab=inline` and enjoy!my_data = !find . | grep .log | xargs grep interesting_event | awk '{print $3}' map(float, my_data) hist(my_data, 12)
EDIT: for context, I wind up using this all the time to tease out information from Riak logs, like how long Bitcask merges take, in aggregate, and for locating particular events in time and characterizing their frequency.
- Walkman 11 years agoI don't get why is this on front page. IPython is awesome, enough said. If you are not using it, you are doing it wrong.
- randlet 11 years agoThe IPython debugger ipdb also makes a great replacement for the builtin pdb.
- randlet 11 years ago
- yeukhon 11 years agoI use IPython whenever possible. But I recently started looking at DreamPie (http://www.dreampie.org/) because I was getting tired of the interpreter line break mode. I'd like to write in a text-file mode and then run. I know I can do this with Vim already but maybe I am just too noob running Python from vim sometimes crash my program or accidentally enter some hell state I can't re-enter my file. I am giving DreamPie a try now.
- akanet 11 years agoI use IPython for the interactive python part of https://coderpad.io - being able to run a block of code and drop you into a REPL on an exception with full syntax coloring and context is killer.
- overgard 11 years agoHow does ipy work with virtual envs? I've always admired the feature list, but my assumption is that it doesn't really run in a virtual env, would that be accurate?
- nsfmc 11 years agoit works fine with virtualenvs, on osx, you can do
on linux, you can avoid the readline install. i have no idea what the windows scene is, but at least for the past four or so years, i've never had a problem with virtualenvs and ipython.virtualenv env . ./env/bin/activate easy_install readline pip install ipython
- brunomlopes 11 years agoOn windows it's the same. Although I think I usually install ipython outside of virtualenvs, because I tend to always use it.
- brunomlopes 11 years ago
- mineo 11 years agoIt prints a warning if you're running ipython inside a virtualenv that some features might not work but in that case, you can just install ipython itself inside the venv (I haven't yet found any problems caused by using ipython inside a venv). Using a python2 ipython inside a python3 venv might not be a good idea, but you probably knew that already :)
- nsfmc 11 years ago
- vonseel 11 years ago%paste is a nifty but simple trick that I find really useful
- mataug 11 years agoOne of my colleagues hates IPython for no particular reason, he prefers using the standard python shell.