1.首先安装cx_oracle包
2.解压instantclient-basic-windows.x64-11.2.0.4.0.zip到c:\oracle
3.拷贝instantclient_11_2下所有.dll文件到c:\python34\lib\site-packages\下(根据自己的python版本拷贝到相应的site-packages文件夹下)
python连接示例代码:
将测试、lint、构建和文档流程编码为命名的Python会话,以便人类和代理每次运行相同的workflow。
# -*- coding: utf-8 -*-import cx_Oracle
conn=cx_Oracle.connect('reporter','password','localhost:1521/ORCL')
cursor=conn.cursor()
sql="select * from test"cursor.execute(sql)
data=cursor.fetchall()print(data)
cursor.close()
conn.commit()
conn.close()Python免费学习笔记(深入):立即使用
在学习笔记中,你将探索 Python 的核心概念和高级技巧!










