How to get information after call to file? Example Input : cmd > python file.py getme
How i can read the string 'getme'?
How to get information after call to file? Example Input : cmd > python file.py getme
How i can read the string 'getme'?
sys.argv
represents the command line arguments. Note the the first element (index 0) is the name of the script. So, in your case:\
import sys
arg = sys.argv[1] # this will contain "getme"
There is a lib to do that argparse, it is easy to use and offers a ruge ways to personalize your parameters.