How to run script in python?

青灯夜游
Release: 2019-05-30 17:34:06
Original
20414 people have browsed it

How to run script in python?

How to run python script:

##Method 1: Script programming

Write a script file and name it as a .py file (for example hello.py):

print ("Hello, Python!");
Copy after login

Open the command line window, then switch to the path of the py file, and then enter "python py file name" , Example

python ./hello.py
Copy after login

Output:

hello,python
Copy after login

Method 2: Use Python’s own IDEL

Python comes with an IDE called IDLE.

Enter the script code in IDLE and press Enter.

How to run script in python?

The above is the detailed content of How to run script in python?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:利用Python自带的IDEL
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template