[Python] I am having problems creating an input with a time limit

Discussão em 'Python' iniciado por Stack, Fevereiro 23, 2025.

  1. Stack

    Stack Membro Participativo

    I want to make an input statement with a time limit, but it does not seem to work. when i input something, I just see three dots on a new line, and it still goes to TimeoutOccurred. I am very new to python, can anyone explain and help me fix this please?

    Here is my code.

    from inputimeout import inputimeout, TimeoutOccurred# <-- pip install inputimeout

    try:
    x = inputimeout("input something ",3)
    except TimeoutOccurred:
    x = "you failed to input in time"
    print(x)

    Continue reading...

Compartilhe esta Página