What is the command to run the python file in Linux
Today, I would like to share with you the relevant knowledge of what the command to run the python file in Linux is, detailed and logical. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article.
1. Upload the python file to the linux server by rz-be command
2. Run chmod + x EngGet.py to make the EngGet.py file executable
3. / EngGet.py runs the python file.
Create and execute Python script vim first.py under Linux
#! / usr/bin/env python
List = [1, 2, 3, 4, 5, 6, 7, 9, 10, 11]
Tuple = (1, 2, 3, 4, 5, 6, 7, 9, 10)
Print (list)
Print (tupl)
Execute py script
Python3 first.py
Or
Chmod upright x first.py
. / first.py
Environment configuration description: #! / usr/bin/python
The path of python under centos
#! / usr/bin/env python
Python paths that can be configured under all linux versions
These are all the contents of the article "what is the command to run python files in Linux?" Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.