Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command-line options to IPython *scripts*?

Tags:

python

ipython

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?

like image 828
JS. Avatar asked Nov 09 '10 20:11

JS.


People also ask

Which is the command to run the script in IPython?

You can use run command in the input prompt to run a Python script. The run command is actually line magic command and should actually be written as %run. However, the %automagic mode is always on by default, so you can omit this.

What does * indicate in Jupyter notebook?

This means that your kernel is busy. If you want to interrupt/stop the execution, go to the menu Kernel and click Interrupt. If it doesn't work, click Restart. You need to go in a new cell and press Shift + Enter to see if it worked. Follow this answer to receive notifications.

What is IPython command?

IPython bridges this gap, and gives you a syntax for executing shell commands directly from within the IPython terminal. The magic happens with the exclamation point: anything appearing after ! on a line will be executed not by the Python kernel, but by the system command-line.

How do I run IPython notebook from command-line?

To launch Jupyter Notebook App: Click on spotlight, type terminal to open a terminal window. Enter the startup folder by typing cd /some_folder_name . Type jupyter notebook to launch the Jupyter Notebook App The notebook interface will appear in a new browser window or tab.


1 Answers

ipython -- sometest.py 1 2 3 4 
like image 145
Aston M. Avatar answered Oct 12 '22 15:10

Aston M.