To get command line arguments from a Python program, you want to use sys.argv.
File printargs.py:
import sys
def main():
print(sys.argv)
main()
sys.argv returns the command line arguments in a list. sys.argv[0] is the name of the Python program that's running.
[D:/tmp]
% printargs this is a test
['printargs.py', 'this', 'is', 'a', 'test']
[D:/tmp]
%
On Windows, to make Python programs runnable as commands as shown above, see
this post.
(You can also just pass the arguments to the program after the program name if you are using the "python" command to run your program.)
[D:/tmp]
% python printargs.py this is a test
['printargs.py', 'this', 'is', 'a', 'test']
[D:/tmp]
%
--Mark