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

    Apr 25, 2014 · If age<=0, ask the user to input a valid number for age again, (i.e. go back to step 1.) 1.2. If age is not float or int data type, then ask user to input her/his age again (i.e. go back …

  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 take user input and use that in function

    Feb 4, 2024 · 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 …

  4. Python: How to keep repeating a program until a specific input is ...

    inp = raw_input() # Get the input while inp != "": # Loop until it is a blank line inp = raw_input() # Get the input again Note that if you are on Python 3.x, you will need to replace raw_input with …

  5. User input boolean in python - Stack Overflow

    Feb 15, 2018 · I am trying to have a user input whether or not they like spicy food and the output is supposed to be a boolean but I don't seem to be getting an output with my code below: def …

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

    This prompts the user for text input and returns it as a string. 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 …

  7. datetime - Python 3.2 input date function - Stack Overflow

    Jan 1, 2013 · The input() method can only take text from the terminal. You'll thus have to figure out a way to parse that text and turn it into a date. You could go about that in two different …

  8. python - User input in dialog box - Stack Overflow

    May 21, 2018 · Is there any library available in python for the graphical user entry input. I know about tk but I believe it takes some line of codes to do that. I am looking for the shortest …

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

    Aug 16, 2021 · 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 …

  10. python - How to let the user select an input from a finite list ...

    Oct 18, 2021 · Is it possible to ask for selection between multiple choices in Python, without an if loop? Example: print &quot;Do you want to enter the door&quot; raw_input (&quot;Yes or …