Python3

$ curl -kL http://xrl.us/pythonbrewinstall | bash
$ source $HOME/.pythonbrew/etc/bashrc
$ pythonbrew install 2.7.2

官方源码: https://github.com/utahta/pythonbrew

中文文档: https://pythonbrew.readthedocs.org

2.1 python shell

@$ python@ 进入shell模式

Python 2.7.3 (default, Aug  1 2012, 05:16:07)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print 'Hello World!' 
HelloWorld!
</pre>

2.2 .py

@$ subl helloworld.py@ 源文件版,保存下面内容, @Ctrl + B@

#!/usr/bin/python
# Fileame : helloworld.py
print 'Hello World!!'

2.3 idle

@$idle-python2.7@ idle版

@Ctrl + N@ 新建窗口输入

@Ctrl + S@ 保存成.py源文件

@F5@ 运行模块

</section>