怎么下载他的库这个就自行百度了,配置完毕之后就用以下代码即可用python连接阿里云odps的数据库了。
from odps import ODPS
o = ODPS('嘿嘿嘿', #这个地方是阿里云的Access Key ID
'哈哈哈哈', #这个地方是阿里云的Access Key Secret
'kf_gdsw_xxzx',
endpoint='http://service.cn-某个阿里云的网址:80/api')
sql="""
select
*
from 某个阿里云的数据库;
"""
with o.execute_sql(sql).open_reader() as reader:
for record in reader:
print(record)
#print(record.djxh)
#sql_ora= "INSERT INTO t_tmp_nfdw_t values ('" + str(record.djxh) + "','" + str(record.nsrmc) + "')"
#print(sql_ora)
#cursor.execute(sql_ora)