About 582,000 results
Open links in new tab
  1. python - Getting user input - Stack Overflow

    In Python 3, it's just input() - caution: there is an input method in 2.x too, but it eval()s the input and is therefore evil. – user395760 Commented Jul 27, 2010 at 16:21

  2. python - User input and command line arguments - Stack Overflow

    To read user input you can try the cmd module for easily creating a mini-command line interpreter (with help texts and autocompletion) and raw_input (input for Python 3+) for reading a line of …

  3. python - How to read keyboard input? - Stack Overflow

    Aug 3, 2022 · Non-blocking, multi-threaded example: As blocking on keyboard input (since the input() function blocks) is frequently not what we want to do (we'd frequently like to keep doing …

  4. Python - How to take user input and use that in function

    Jun 18, 2016 · In Python 2, you should accept user inputs with raw_input(): Check this. x=int(raw_input("Enter first number")) y=int(raw_input("Enter second number")) Please follow a …

  5. Asking the user for input until they give a valid response

    Apr 25, 2014 · prompting the user for input with get_input until the input is ok; validating using a validator function that can be passed to get_input; It can be kept as simple as (Python 3.8+, …

  6. How to use threading to get user input realtime while main still ...

    Aug 2, 2015 · Hi, thanks for your advice. I wanna run two function in the while loop, one is my base function, which will run all the time, the other function is input function, when user input …

  7. python - How do I read from stdin? - Stack Overflow

    Sep 20, 2009 · If you want to prompt the user for input, you can use raw_input in Python 2.X, and just input in Python 3. If you actually just want to read command-line options, you can access …

  8. python - How can I read inputs as numbers? - Stack Overflow

    Dec 8, 2013 · Python 2's input function evaluated the received data, converting it to an integer implicitly (read the next section to understand the implication), but Python 3's input function …

  9. How to give jupyter cell standard input in python?

    Jan 23, 2016 · Nothing worked as long as input() was the first line, but after putting some arbitrary statements before the first input(), all of the input()s just started working. So, maybe try a …

  10. Python 2.7 getting user input and manipulating as string without ...

    We can use the raw_input() function in Python 2 and the input() function in Python 3. By default the input function takes an input in string format. For other data type you have to cast the user …

Refresh