Vim opens our Python journey

Source: Internet
Author: User

1, open "terminal" in our Mac system, enter Python, and then enter to see if our computer is installed Python, and its version, here is my 2.7.5 version, if not installed please Baidu.

2, >>> after that we can directly enter the Python source code

First we enter: print ' Hello python ', then enter to see the output Hello Python

Control+d can exit Python

3, we now use VIM to create a new Python source program, Python original file is. PY,

3.1. Type in terminal: Vim hellopython.py (indicates new one Hellopython) source program

3.2. Enter the following 3 lines in the new vim: The first 2 lines indicate the comment, #后面都是注释, print ' Hello Python ' indicates that you want to output Hello Python

#!/usr/bin/python

#/filename:hellopython

print ' Hello python '

3.3. Press "ESC", then "shift" + ";" and then enter WQ to save the file and exit.

4. Run our Python program

4.1. Enter Python hellopython.py return to see output hello Python

Vim opens our Python journey

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.