So I've been trying out some things in Python to refresh my mind.
I've been following 'Learn Python the Hard Way' book and they introduced me to argv.
However, for whatever reason, argv seems to be taking the filename as an argument as well, which I don't think should be happening.
My code looks like this:
from sys import argv
value1, value2 = argv
print("Hi")
print("you seem bored")
print(value1)
print(value2)
And this is what I'm getting on the terminal:
userblahblah:Python nut$ python3 another_test.py hi po
Traceback (most recent call last):
File "another_test.py", line 3, in <module>
value1, value2 = argv
ValueError: too many values to unpack (expected 2)
When I feed in one argument, this is the output:
notrealname:Python nut$ python3 another_test.py hi
Hi
you seem bored
another_test.py
hi