Python First Step Hello World_python

Source: Internet
Author: User
First download the latest version of Python. Www.python.org, the current version is 3.1.

Next is the installation, which, like other applications, is installed under Windows, with little repetition.

Under Windows, you can use the command line, or you can use idle to develop Python. First, let's describe the command-line approach: set path, add the Python installation path to the PATH environment variable. Entering Python at the command line displays the appropriate version number and goes into the Python workspace. Another way is idle, which is the development environment of the Python default installation.

Next, let's experiment with the most traditional and famous Hello World program.

Python is a scripting language. So, you can run it interactively, or you can use the form of a file to run it.

First, introduce the interactive approach: Open idle, enter print (' Hello World ') command to get the output of Hello world. The same method is used in the command line.

Next, save the Python statement to a file and run the Python file. In idle, select File->new window, write the previous Python statement in a new window, and save it as a hello.py file. Click Run or F5. If you need to run a python file on the command line, use the Python command. Enter the directory where the. py file file is located, and type the Python hello.py. Or specify the python file path directly in the command.

In this way, the simple "Hello World" is done and move on!
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.