Python Foundation 2-hello,world

Source: Internet
Author: User

First program hello,world!

Interactive programming:
In the terminal window, enter:
Python
Enter Python interactive mode after carriage return, then enter in the prompt >>> follow:
print ' hello,world! '
Then output on the screen:
hello,world!

Note: If you are running on a version of 3.x, you should use parentheses in the print statement
Print (' hello,world! ')

Script Programming:
First write a script through the editor such as:
print ' hello,world! '
Then save as **.py file
Then run Python **.py on the command line to execute the script

Note: If the script executes on Linux, add the Execute permission and then execute
chmod +x **.py
./**.py (You must first add executable permissions, otherwise you need to execute with Python **.py)

Python Foundation 2-hello,world

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.