The terminal directly executes the py file without the python command,
Then grant the script file running permission,
Method (1) chmod + x./*. py
Method (2) chmod 755./*. py (777 does not matter)
If this command is not adjusted, the permission denied error will occur.
Run the command directly on the terminal.
If a comment similar to the following is provided at the beginning of the script content:
#! /Usr/bin/env python(Or #! /Usr/bin/python)
Then you can run it directly on the terminal:
./*. Py
Without this comment
Run the following command on the terminal:
Python./*. py
(Note: In some linux versions, you must add python as a command in front of python even if it is commented out above.
Otherwise, if the file./*. py is not a command, the./*. py not found error may occur. That is, this command cannot be found. Of course)
If there is a GUI script
After the previous chmod, double-click it to execute it.
In the above discussion, the terminal directly executes the py file. If you do not need the python command, it means all the content that I want to share with you. I hope you can give us a reference and support the help house.