Several methods to pause the python program in pycharm

1、input();

    This method does not need to include modules, so this is also the most commonly used method of suspending.

    The raw_input() and input() statements in Python2 have been merged into input() in Python3.

2、os.system("pause");

    This method needs to include the os module (import os), and the cmd command line will pop up when IDLE runs under windows.

    To perform a pause operation, directly running the .py file will directly pause on the command line.

3、time.sleep("second");

    This method needs to include the time module (import time), second is a custom time length, according to the actual situation,

    It may fluctuate up and down.

Guess you like

Origin blog.csdn.net/nyist_yangguang/article/details/114874595