Live data from Hacker News

Why IPy: reasons for using IPython interactively

fastml.com

11–16 of 16 posts

Re: Why IPy: reasons for using IPython interactively

#11
post #7
post #6

How 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?

it works fine with virtualenvs, on osx, you can do virtualenv env . ./env/bin/activate easy_install readline pip install ipython 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.

On windows it's the same. Although I think I usually install ipython outside of virtualenvs, because I tend to always use it.

Re: Why IPy: reasons for using IPython interactively

#12
post #6

How 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?

It 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 :)

Re: Why IPy: reasons for using IPython interactively

#13
I 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.

Re: Why IPy: reasons for using IPython interactively

#16
The 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:

    my_data = !find . | grep .log | xargs grep interesting_event | awk '{print $3}'
    map(float, my_data)
    hist(my_data, 12)
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!

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.

Post reply on HN