I want to run my program if I type a specific command.
My Python program should take the test file as a command line argument. For example in the command prompt or the terminal, my program should run if you type “python my_program.py test.txt”.
use the execfile built-in function from python, you can google it, there are many answers as well on this site with this info. Make research before asking.
How to run a program by typing a specific command