python - IPython : Running a . 使用现有变量的py文件

标签 python ipython

是否可以使用先前执行中的现有变量来运行 .py 代码文件?我的意思是使用内存中的变量运行新的 .py 文件,即输入 who 命令时看到的变量。

最佳答案

在 Ipython 中,使用 run -i myscript.py。从文档中,

-i run the file in IPython's namespace instead of an empty one. This is useful if you are experimenting with code written in a text editor which depends on variables defined interactively.

关于python - IPython : Running a . 使用现有变量的py文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22557975/

相关文章:

python - pypfop 0.2.0 和环境变量 FOP_CMD

python - 在 Flask-admin ModelView 中对自定义字段进行过滤和排序

python - 比较两个名字和姓氏列表以找到匹配项

python - 使用 shell 命令暂停 IPython 脚本?

python - 如何使 IPython 笔记本 matplotlib 绘图内联

Python Pandas - 具有不同列的 Concat 数据框忽略列名

python - PerformanceWarning : DataFrame is highly fragmented. 这通常是多次调用 `frame.insert`的结果,性能较差

python - Python 中的 %timeit 是什么?

python - 是否有 erlang 的 ipython 等价物?

python - ipywidgets,如何更改 slider 的值显示精度