Home  >  Article  >  Backend Development  >  How to run script in python?

How to run script in python?

青灯夜游
青灯夜游Original
2019-05-30 17:34:0620270browse

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!");

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

Output:

hello,python

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!

Statement:
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