[IPython-User] running "ipython myscript.py"

Paul Ivanov pivanov314@gmail....
Wed Mar 9 15:33:20 CST 2011


Alan Wilter Sousa da Silva, on 2011-03-09 11:45,  wrote:
> Thanks Paul,
> 
> And how to make my script executable? I mean I tried to put in my test.ipy:
> 
> #!/sw/arch/bin/ipython
> 
> then:
> 
> chmod +x test.ipy
> 
> but
> 
> ./test.ipy
> 
> won't work.

Hi Alan,

what is the error message? Doing the equivalent worked for me on
the current 0.10.2 git branch using python 2.6.5 (with a
deprecation warning about os.popen3). Try this simple three line
program and see if that works for you.

$ cat tmp.ipy 
#!/usr/bin/env ipython
message = !echo it works.
print message
$ ./tmp.ipy 
/home/pi/tmp/local/lib/python2.6/site-packages/IPython/genutils.py:437:
DeprecationWarning: os.popen3 is deprecated.  Use the subprocess
module.  pin,pout,perr = os.popen3(cmd)
['it works.']


best,
-- 
Paul Ivanov
314 address only used for lists,  off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
Url : http://mail.scipy.org/pipermail/ipython-user/attachments/20110309/aef2bc51/attachment.bin 


More information about the IPython-User mailing list