Pause in Python

后端 未结 13 1301
臣服心动
臣服心动 2020-12-24 10:59

I am running command-line Python scripts from the Windows taskbar by having a shortcut pointing to the Python interpreter with the actual script as a parameter.

Afte

13条回答
  •  没有蜡笔的小新
    2020-12-24 11:26

    There's a simple way to do this, you can use keyboard module's wait function. For example, you can do:

    import keyboard
    print("things before the pause")
    keyboard.wait("esc") # esc is just an example, you can obviously put every key you want
    print("things after the pause")
    

提交回复
热议问题