1. First create the file (cd to the directory where it needs to be placed) touch myTest.py 2. Edit myTest.py vi myTest.py Add content inside #! /usr/bin/env python Then add the code you need to add print('hello, world!') Then enter command mode, :wq save and exit vi 3. Change the permissions of myTest.py as needed. This is mainly used for testing, so do not set it to 777 chmod 777 myTest.py 4. This is to run myTest.py directly in the current directory (similar to directly executing exe in windows) ./myTest.py The above method of directly running py files in Linux is all the content that the editor shares with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Detailed explanation of JS ES6 coding standards
>>: Why do select @@session.tx_read_only appear in DB in large quantities?
Automatic web page refresh: Add the following code...
In the development environment, the vue project i...
Table of contents 2 solutions for file upload Bas...
Table of contents ESLint plugin installation in H...
Detailed explanation of the implementation method...
1.1 Copy the nginx installation package and insta...
Open the cpanel management backend, under the &qu...
Preface tcpdump is a well-known command-line pack...
The ".zip" format is used to compress f...
Table of contents Overview in operator refinement...
Installation path: /application/mysql-5.7.18 1. P...
Background of the accident: A few days ago, due t...
//Default protocol /The use of the default protoc...
First: Start and stop the mysql service net stop ...
1. Initialize data DROP TABLE IF EXISTS `test_01`...