Commit 59f7ecf2 authored by 张彦钊's avatar 张彦钊

add

parent 4967508e
import redis
import json
tag_key = "meigou_check_in_tag_ids"
T1 = [85,86,87,5057,88,89,101,102,777,780,95,890,2923,844,258,912,914,1324,2108,2935,5063,
185,915,916,2936,2937,2938,5064,188,775,824,1703,2939,3041,3049,5067,5068,180,187,
246,821,825,1966,2072,5065,2060,2778,2941,5066,835,828,830,831,832,833,834,918,919,5069,36,171,
181,2065,2066,2067,2068,2948,6160,2450,917,2455,5070,2459,2460,822,872,873,926,928,2063,2866,5072,
199,200,201,202,203,204,205,206,207,243,244,787,930,931,1801,2352,5073,97,99,115,121,123,137,141,
152,197,776,804,868,885,954,5074,117,237,842,5077,778,782,783,784,785,788,789,2946,3043,2059,4437,98,114,120,125,135,136,140,153,793,805,886,1890,15,17,19,975,72,34,35,41,47,1387,1992,2942,2663,154,155,157,852,61,79,1055,2033,3042,3044,6147,2112]
r = redis.StrictRedis.from_url('redis://:ReDis!GmTx*0aN6@172.16.40.133:6379')
r.set(tag_key,json.dumps(T1))
......@@ -22,6 +22,15 @@ def get_city():
df.to_csv('/tmp/city.csv',index=False)
def write_city():
a = [[1, '2', '3'], ['4', '5', '6']]
b = pd.DataFrame(a)
from sqlalchemy import create_engine
yconnect = create_engine('mysql+pymysql://root:3SYz54LS9#^9sBvC@10.66.157.22:4000/jerry_test?charset=utf8')
pd.io.sql.to_sql(df, table, yconnect, schema='jerry_test', if_exists='append', index=False)
if __name__ == "__main__":
get_city()
......
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