![](/img/trans.png)
[英]How to start Python IDLE from python.exe window if possible, and if not, what is python.exe even used for?
[英]Python idle to python.exe
So I've made a script/code in python idle and want to run it on python.exe but whenever I do this the you can see the python window pop up briefly for a second before closing, and I want to run my code using python 而不是空闲,我该怎么做?
因为我还不能评论:
go 到命令行并打开文件位置目录并输入:python filename.py
这可以使用两种方法来完成。 第一个是使用 cmd。 例如YOUR_WORKING_DIR>python filename.py
另一种方法是创建执行特定 python 代码的.bat
(批处理)文件。 让我们假设您想使用批处理文件运行my_python_file.py
。 与此类似的相关脚本,
ECHO ON
python my_python_file.py
PAUSE
将此文件另存为.bat
扩展名,然后双击它,如果上述方法对您不起作用,请参考此答案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.