Ethan Neidhart
Ethan Neidhart

Reputation: 75

Makefile for python with command line args

I have a python script which I call from the terminal like:
python myscript.py arg1 arg2 arg3

Now I want to create a Makefile which will allow calling
./myscript arg1 arg2 arg3
to do the same as the first command, but I'm not sure how to do this (mostly because of the additional command line args). How do I write this Makefile?

Upvotes: 0

Views: 978

Answers (1)

Mohammad Yusuf
Mohammad Yusuf

Reputation: 17074

Include your python path on the first line of your myscript.py

#!/usr/bin/python

Then make your script executable

chmod +x myscript.py

You can rename myscript.py to myscript if you will.

Now you can run it the way you wanted.

Upvotes: 1

Related Questions