Commit 767e6982 authored by qianyanyan's avatar qianyanyan

change conn_database

parent 87b8feb6
Pipeline #71 failed with stages
......@@ -12,32 +12,6 @@ curs.execute(sql)
data = curs.fetchall()
print("python原始数据:",data)
print(type(data))
data_len = len(data)
print(data_len,data[0])
data_len_1 = len(data[0][0])
print(data_len_1,data[0][0]['zr'])
#print(data_len_1,data[0][0])
file_handle = open('D:/mywork/f11.txt',mode='w')
file_handle.write(str(data[0][0]))
file_handle.close()
#data2=json.loads(data)
#print(type(data2))
json_str = json.dumps(data[0])
print("JSON 对象:", json_str)
print(type(json_str))
file_handle = open('D:/mywork/f2.txt',mode='w')
file_handle.write(str(json_str))
file_handle.close()
data1=json.loads(json_str)
print(data1)
print(type(data1))
file_handle = open('D:/mywork/f3.txt',mode='w')
file_handle.write(str(data1))
file_handle.close()
curs.close()
conn.close()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment