[IPython-User] $ sign is removed in magic function

Zoltán Vörös zvoros@gmail....
Mon Jan 2 11:43:56 CST 2012


Greetings Thomas,

Thanks for the clarification! I think I can live without the $ sign. ! 
or & should also be OK. They seem to pass. # doesn't work, though;)
Cheers,
Zoltán

On 01/02/2012 05:53 PM, Thomas Kluyver wrote:
> 2012/1/1 Zoltán Vörös <zvoros@gmail.com <mailto:zvoros@gmail.com>>
>
>     If I run this in an ipython shell as
>
>         In [24]: %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 [5]: cmd = "math.factorial(100)"
> In [6]: %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 $?
>
> Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20120102/8e3b4014/attachment.html 


More information about the IPython-User mailing list