一 安装cx_Oracle包
下载地址
http://www.python.net/crew/atuining/cx_Oracle/http://cx-oracle.sourceforge.net/二 设置环境变量
export LD_LIBRARY_PATH=/opt/oracle/product/11.2.0.3/dbhome_1/lib/
三 测试
#vim 1.py
import cx_Oracle
conn=cx_Oracle.connect("scott","oracle","demo189")
cursor=conn.cursor()
cursor.execute("""select empno,ename,job from scott.emp""")
for empno,ename,job in cursor :
print "values:",empno,ename,job
#chmod +x 1.py
#python 1.py
如果成功表未环境配成功了