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