May-15-2019, 05:35 PM
I have been playing with argparse for a a few hours and can't figure out something so simple.
What i then want to do is in linux:
python test_file_name.py hi
I then want to to print out "hi"
but i get this message instead:
"Error: unrecognized arguments: hi
1 2 3 4 5 6 7 |
import argparse parser = argparse.ArgumentParser() parser.add_argument( "tst" ) args = parser.parse_args() print (args.tst) |
python test_file_name.py hi
I then want to to print out "hi"
but i get this message instead:
"Error: unrecognized arguments: hi