Python Forum

Full Version: How do I accept input from the terminal when I execute my file?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've been trying to figure this out for a while now.
When I execute my file using python file.py, how can I send input like this: python file.py 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: http://stackoverflow.com/questions/10098...-in-python