[IPython-dev] magic for getting exit status

Ben Holroyd ben_holroyd_1@hotmail....
Mon Apr 27 06:58:36 CDT 2009

I'm posting this after being advised to get other peoples feedback on a bug report on launch pad.






        What I'm suggesting is basically something similar to $? in bash to get the
exit status, both for magic functions, and normal programs run through
the shell.

At the moment there isn't a way of checking if a
magic function successfully did what it was supposed to, and no way of
returning an exit status without it displaying on screen.

example: i wrote a magic to cd to a directory and ls its contents
(cdl), the obvious way would be to use the existing cd command, except
you can't test if its run successfully.

I know you can use the subprocess or commands module to get exit
codes but its not straight forward and has the disadvantage that you
can't check after the fact if a program exited successfully.

Any thoughts?

Share your photos with Windows Live Photos – Free.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-dev/attachments/20090427/4d9b639d/attachment.html 

More information about the IPython-dev mailing list