[IPython-User] $ sign is removed in magic function
Mon Jan 2 10:53:22 CST 2012
2012/1/1 Zoltán Vörös <firstname.lastname@example.org>
> If I run this in an ipython shell as
> In : %fimp foo.dat $123
> [u'foo.dat', u'123']
> i.e., the $ sign is removed. However, if I do this on the command line
The $ sign is part of the magic system, for dropping Python variables into
your commands, so you can do things like this:
In : cmd = "math.factorial(100)"
In : %timeit $cmd
When you do $3, it evaluates it as the integer literal 3.
It's replaced before the arguments are passed to your function, and there
isn't a way to override it from inside the function. Is there another
symbol you could use instead of $?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-User