import sys
my_variable_name = sys.argv[1] # first argument
Example:
# test.py
import sys
print(f"Is your name Paul {sys.argv[1]}?")
python3 test.py "Atreides"
⬇︎
Is your name Paul Atreides?
note to self: work on shorter titles.
import sys
my_variable_name = sys.argv[1] # first argument
Example:
# test.py
import sys
print(f"Is your name Paul {sys.argv[1]}?")
python3 test.py "Atreides"
⬇︎
Is your name Paul Atreides?