python
[[email protected] ~]# python --version 查看python版本
Python 2.7.5
[[email protected] ~]# python
Python 2.7.5 (default, Feb 11 2014, 07:46:25)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print "six six six"
six six six
>>> python使用print打印
[[email protected] ~]# vim pp.py
#!/usr/bin/env python 使用env的原因:与3.0达到同步
print "learn python well"
[[email protected] ~]# chmod +x pp.py 加上可执行权限
[[email protected] ~]# python pp.py 执行
learn python well
[[email protected] ~]# vim pp.py
#!/usr/bin/env python
print "中国人"
[[email protected] ~]# python pp.py
File "pp.py", line 2
SyntaxError: Non-ASCII character ‘\xe4‘ in file pp.py on line 2, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
[[email protected] ~]# vim pp.py
[[email protected] ~]# python pp.py
中国人
#!/usr/bin/env python
#coding:utf-8 编码格式
print "中国人"
Python解释器
cpython,ipython
yum install python -y 安装python