gpt4 book ai didi

python - 如何在交互式 shell 中加载 python 脚本

转载 作者:行者123 更新时间:2023-11-28 21:15:30 26 4
gpt4 key购买 nike

我正在尝试 sudo python get_gps.py -c 并期望它加载脚本,然后呈现交互式 shell 以实时调试脚本,而不是手动输入脚本。

最佳答案

来自文档:

$ python --help
usage: /usr/bin/python2.7 [option] ... [-c cmd | -m mod | file | -] [arg] ...
Options and arguments (and corresponding environment variables):
-B : don't write .py[co] files on import; also PYTHONDONTWRITEBYTECODE=x
-c cmd : program passed in as string (terminates option list)
-d : debug output from parser; also PYTHONDEBUG=x
-E : ignore PYTHON* environment variables (such as PYTHONPATH)
-h : print this help message and exit (also --help)
-i : inspect interactively after running script; forces a prompt even
if stdin does not appear to be a terminal; also PYTHONINSPECT=x

使用-i选项

关于python - 如何在交互式 shell 中加载 python 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30088390/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com