I had a small python script that enters data from command line arguments and does some operations using the inputs I entered and displaying the result
Below is a working example code
some_file.py
import sys arguments = sys.argv first_name = sys.argv[1] second_name = sys.argv[2] print "Hello {0} {1} !!!!".format(first_name,second_name)
Now I do it like
python some_file.py Steve jobs
Result:
Hello Steve Jobs !!!!
Now, what I want, I do not want to use the python command before the file name and the python file name extension, i.e. I want to run the file as a command tool, as shown below
some_file Steve Jobs
what to do to run a python file as above?
source share