<div class="gmail_quote">On 28 September 2011 03:38, Arthur Woll <span dir="ltr"><<a href="mailto:arthurwoll@cornell.edu">arthurwoll@cornell.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">Hi all,<br>
<br>
I'm looking for an example of how to use ipython to implement (modest) input prefiltering as described in various places for pre-0.11 versions of ipython.<br>
<br>
For example the old ipthonrc-physics "profile" (loaded using "ipython -p physics") allows input such as:<br>
<br>
In [1]: a = 10 lb<br>
<br>
(Described here: <a href="http://fperez.org/papers/ipython07_pe-gr_cise.pdf" target="_blank">http://fperez.org/papers/ipython07_pe-gr_cise.pdf</a>)<br>
<br>
and translates this to<br>
<br>
a = PhysicalQuantityInteractive(10, 'lb')<br>
<br>
Any suggestions?</div></div></blockquote><div><br>Hi Arthur,<br><br>I don't think there's anything directly equivalent in 0.11, but you can have a look at the prefiltering system here:<br><br><a href="https://github.com/ipython/ipython/blob/master/IPython/core/prefilter.py">https://github.com/ipython/ipython/blob/master/IPython/core/prefilter.py</a><br>
<br>Also, the deprecated module which allowed "a = 10 lb" in older versions can be seen here:<br><br><a href="https://github.com/ipython/ipython/blob/master/IPython/deathrow/PhysicalQInput.py">https://github.com/ipython/ipython/blob/master/IPython/deathrow/PhysicalQInput.py</a><br>
<br>Hope that helps,<br>Thomas<br></div></div>