Alex Rivera | Logout

Command-line options to IPython *scripts*?

Asked 2010-11-09T20:18:19.067
41

I am often asked to debug Python scripts written by others. I would like to send these scripts to IPython so it will drop into an IPython shell at the point the script fails.

Unfortunately, I cannot find a way to send (required) command-line options required by the scripts.

IPython assumes everything in is for IPython when I pass the script and its options as:

ipython <script_name> <script_options>

Is there a solution or workaround?

Edit
Report

1 Answer

32
ipython -i -c "%run test.py 1 2 3 4"
answered 2010-11-09T20:23:36.380

Your Answer