Is there a way to switch the "python [filename].py to a shortcut

Question:

Is there a way to switch the "python [filename].py to a shortcut like "shutdown" for example?

Asked By: Mustafa

||

Answers:

If you’re on Linux, then go to the end of your bash configuration file (found at ~/.bashrc), and add the line:

alias shutdown="python filename.py"

If you’re on Windows, then create a file with the following line:

python filename.py

Then save the file as shutdown.bat and put it in your Windows directory (at C:WINDOWS, also abbreviated as %windir%).

Answered By: Xiddoc
Categories: questions Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.