IPython *脚本*的命令行选项? [英] Command-line options to IPython *scripts*?

查看:54
本文介绍了IPython *脚本*的命令行选项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

经常有人要求我调试别人编写的Python脚本.我想将这些脚本发送到IPython,以便在脚本失败时将其放入IPython shell中.

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假定其中的所有内容均适用于IPython:

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?

推荐答案

ipython -i -c "%run test.py 1 2 3 4"

这篇关于IPython *脚本*的命令行选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆