If you want to run a python script just writing its name from the command line, without having to write py script_name.py, you can:
- create a batch file (.bat) like this
py script_name.py
This worked for me:
- go in the variable environment setting (type var in the search bar and it will show up)
- in the global settings
- choose path,
- then modify,
- then add the path to your .bat file (without the .bat file)
- close everything: done.
Open the cmd, write the name of the .bat file and it will work
In the pymemo.bat you can write
python book20.py
so that you can launch that script from everywhere just typing pymemo in the command line (you can obviously change the names of the files to more intuitive ones).
Subscribe to the newsletter for updates
Tkinter templates
My youtube channel
Twitter: @pythonprogrammi - python_pygame