Create a Python Program

Source: Internet
Author: User

1. Create a Python Program

Welcome to the Python world! This series of articles tells you how to write Python programs. Python is only a text file, which is the same as a common text file, but such a text file can be viewed and run in the Python environment. You can use a standard text editor to edit it. The text editor you want to use depends on the text editor of your computer system. Of course, if you want to improve efficiency and facilitate writing, using a text editor with Python syntax highlighted is the best choice.

1.1 Hello, World

Every programmer, when learning a language, likes to write the simplest program "Hello, World ". This program is to output a simple English sentence "Hello, World !", It's over, and nothing else is done. Let's use Python to compile this simple and famous program! Open the text editor you are familiar with, create a file, and save the file name as hello. py. Enter the following line of code in this file:

Print ("Hello, world! ")

This program simply outputs a line of text to the terminal, which is implemented using the print function. The print function outputs its parameters and moves the cursor to the next row.

So far, you have written the first program. It's easy enough. Let's run it! If you are on windows, you can install the original python installation package, or run it using the Milang IDE provided by me. If you are running this file on Linux, just run it on the terminal, because Linux has been installed in advance and comes with the system. Here I mainly use Milang for editing and running, and you can download (http://blog.csdn.net/caimouse/article/details/11815095) from here to install Milang ). Milang is an IDE that integrates the Notepad ++ editor and the Python 3.4 compiler. This makes it more convenient. You only need to install it to edit the code and then run the Code with one click, simple and efficient. If you cannot run in your Windows, please download the run patch library of VC2013 (http://www.microsoft.com/en-us/download/details.aspx? Id = 40784 ).

 

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.