[英]How to execute python script using python command
When I execute a python script in the Pycharm IDE, It executes the script with the path to the python executable like so: path/to/python/executable path/to/the/script/foo.py
有没有办法使用 python 命令执行它,例如: python3 path/to/the/script/foo.py
?
我知道这没什么区别,我知道我可以在终端中输入命令,但我希望通过按Ctrl+Shift+F10
(执行脚本的快捷键)或按“运行”按钮。
为什么要这样专门运行它? 如果您想使用一些系统解释器,那么您可以在 PyCharm 中配置它并使用它来运行您的所有脚本或仅运行特定的脚本。 因此,如果您想使用解释器 A作为项目解释器并使用解释器 B来运行某些脚本,那么只需在 PyCharm 中配置解释器 B并将其设置为运行/调试配置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.