How to do “hit any key” in python?

后端 未结 7 1780
予麋鹿
予麋鹿 2020-12-01 09:00

How would I do a \"hit any key\" (or grab a menu option) in Python?

  • raw_input requires you hit return.
  • Windows msvcrt has getch() and getche().
  • <
相关标签:
7条回答
  • 2020-12-01 10:00

    Another option:

    import keyboard
    print("Press any key to continue")
    keyboard.read_key()
    print("to be continued...")
    
    0 讨论(0)
提交回复
热议问题