0

I am writing a program where I want to implement that you have to press "any key to continiue", I did that by using command input(), but the problem with this is, when you run the code, you have to press any key and then enter afterwards. Is there a command similar to input() where you don't have to press enter afterwards?

The code I wrote:

    ...

    TimeLoop = False
    start_timer = input("Press any button to start ")
    if start_timer != 3:
        TimeLoop = True
    else:
        TimeLoop = True
    while TimeLoop:
    ...
Murg
  • 129
  • 2
  • 11
  • 2
    Possible duplicate of [What's the simplest way of detecting keyboard input in python from the terminal?](https://stackoverflow.com/questions/13207678/whats-the-simplest-way-of-detecting-keyboard-input-in-python-from-the-terminal) (This actually have thorough explanations of the different alternatives with implementation examples. It's extremely good/useful and is worth your upvote if you use it). – Torxed Jan 30 '19 at 13:15
  • 1
    Do not use `raw_input` as Torxed stated, this function only works in Python2.x. You have to use `input` in Python3.x. – DWuest Jan 30 '19 at 13:18
  • Oh shit, you're right @DWuest. My apologies. To many Python2 vs Python3 questions for today. – Torxed Jan 30 '19 at 13:18

0 Answers0