如何在按下按钮之前暂停程序

use*_*046 2 python py2exe

我正在使用py2exe来制作可执行文件.我想知道如何在按下按钮之前暂停程序..就像我们在C中使用一样system("pause");

当程序在Windows中自动终止时,我需要这个工具.

有没有什么比py2exe做类似的工作更好?

小智 6

您可以在Python2中使用raw_input,或在Python 3中输入

raw_input("Press Enter to terminate.")
Run Code Online (Sandbox Code Playgroud)