#!/bin/bash
cd /tmp
wget http://www.python.org/ftp/python/2.7.5/Python-2.7.5.tgz
tar zxvf Python-2.7.5.tgz
cd Python-2.7.5
./configure --prefix /opt/python && make && make install
echo "export PYTHON=/opt/python/
export PATH=\$PYTHON/bin:\$PATH " >> /etc/profile
source /etc/profile
<----------------------------------------------------------------------------------------------------------------->
[root@kvm Python-2.7.5]# python
Python 2.7.5 (default, Sep 3 2013, 16:59:32)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print "luxiaosi"
luxiaosi
>>>