Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 How do I accept input from the terminal when I execute my file?
I've been trying to figure this out for a while now.
When I execute my file using python, how can I send input like this: python inputstring?
name = input('Please enter your name: ')
# for python 2.7 use rawinput()
from command line, place variables after script name, and read in with argv:

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  How to write a script to execute a program need passing additional input? larkypython 2 216 Nov-23-2019, 04:38 AM
Last Post: larkypython
  Execute .sql file in python pradeepkumarbe 3 1,491 Nov-05-2019, 08:55 AM
Last Post: MckJohan
  Read CSV file into MySQL and use executemany instead of execute bluethundr 1 738 May-04-2019, 07:35 AM
Last Post: MvGulik
  What is the correct type hint when you want to accept Iterable but not Dictionary LadySvetlana 4 468 Mar-05-2019, 07:33 PM
Last Post: LadySvetlana
  Run .py file in Kali Linux Terminal grayarea3 4 4,418 Feb-27-2019, 06:51 PM
Last Post: buran
  Pyodbc does not accept variable from tkinter diegoctn 9 658 Feb-12-2019, 05:12 PM
Last Post: Larz60+
  Loops - new terminal output to file for each loop jm_ice 1 466 Dec-21-2018, 02:42 PM
Last Post: ichabod801
  Read from a file, get user input in a while loop lynden 8 999 Nov-05-2018, 12:31 PM
Last Post: lynden
  Execute a file within another Python file in Spyder Antonio 1 897 Jun-11-2018, 08:10 PM
Last Post: snippsat
  New to Python-Unable to run a .py file in terminal AshishSangwan 3 968 Feb-15-2018, 02:49 PM
Last Post: AshishSangwan

Forum Jump:

Users browsing this thread: 1 Guest(s)