About 739,000 results
Open links in new tab
  1. Asking the user for input until they give a valid response

    Apr 25, 2014 · You can make the input statement a while True loop so it repeatedly asks for the users input and then break that loop if the user enters the response you would like.

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

    634 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 text …

  3. python - Prompt user for file input - Stack Overflow

    In your case, this will prompt for a file path to be input. If you add an argument to this function, it prints something without a newline before input is requested, for example:

  4. Choosing a file in Python with simple Dialog - Stack Overflow

    Sep 12, 2017 · I would like to get file path as input in my Python console application. Currently I can only ask for full path as an input in the console. Is there a way to trigger a simple user interface where...

  5. python - How to redo an input if user enters invalid answer - Stack ...

    Closed last year. I'm new to programming, and I was wondering how I can repeat an input section, if the user types in invalid data. I want the application to just repeat the input section, instead of having to …

  6. How do i ask user for input continuously until they say "Stop"

    Mar 14, 2022 · Closed last year. I am creating a program where I have to ask the user the same question, until they type "Stop" My issue is, The user input has to be a float, but still be able to …

  7. python - Getting a hidden password input - Stack Overflow

    The better why do it is to focus instead on the ability to use a 'password helper', like "system-ask-password" which already provides a 'star password input'. SSH and SUDO can both do this! The …

  8. python - Get a list of numbers as input from the user - Stack Overflow

    numbers = input() print(len(numbers)) the input [1,2,3] and 1 2 3 gives a result of 7 and 5 respectively – it seems to interpret the input as if it were a string. Is there any direct way to make a list out of it? …

  9. python - Getting user input - Stack Overflow

    Do you want the file name to come from user input or a command line argument? (e.g. python myScript.py inputfile.txt)

  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 input. In Python …