Answer the question
In order to leave comments, you need to log in
How to make python script its own command for windows command line?
Good afternoon. I have some working python script that I can run from its location directory by typing on the command line: "python <script name>.py".
What needs to be done so that I can run it as a command (giving it any name I want) from any directory?
Thanks in advance for any help
Answer the question
In order to leave comments, you need to log in
Under linux, specify at the beginning of the file, for example #!/usr/bin/env python3
But before that, make the script file executable by setting the special attribute chmod +x script.py
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question