I have a python script, let's call it my_script.py
. The script is supposed to generate simulated responses to an api call performed on the command line.
What I am looking for is some way to have a custom command line command, e.g. run-my-script
execute my_script.py
while allowing for my_script.py
to accept keyword arguments.
It would be great to have a solution that doesn't require external libraries and that allows for keyword arguments to be passed from the command line to that function.
Is there a way to have a custom command on the command line, like run-my-script
trigger my_script.py?
Though it would be easiest to just run python my_script.py
from the command line, for my use case I need to have the python script triggered just by run-my-script
alone.