Commit de3f51fa by larosa

add test

parent 2898159d
Showing with 15 additions and 15 deletions
...@@ -18,19 +18,19 @@ config_prod = { ...@@ -18,19 +18,19 @@ config_prod = {
conf = config_prod conf = config_prod
# if __name__ == '__main__': if __name__ == '__main__':
# host = conf["redis"]["host"] host = conf["redis"]["host"]
# port = conf["redis"]["port"] port = conf["redis"]["port"]
# password = conf["redis"]["password"] password = conf["redis"]["password"]
# db = redis.Redis(host=host, port=port, password=password, decode_responses=True) db = redis.Redis(host=host, port=port, password=password, decode_responses=True)
# ans = db.hgetall("shop_distribution") ans = db.hget("jd_ext_attr", "33836")
# print(ans) print(ans)
if __name__ == '__main__': # if __name__ == '__main__':
query_sql = "select * from lie_shop_push_sku_log" # query_sql = "select * from lie_shop_push_sku_log"
db = pymysql.connect(host=conf["mysql"]["host"], port=3306, user=conf["mysql"]["user"], password=conf["mysql"]["password"], database=conf["mysql"]["database"]) # db = pymysql.connect(host=conf["mysql"]["host"], port=3306, user=conf["mysql"]["user"], password=conf["mysql"]["password"], database=conf["mysql"]["database"])
cursor = db.cursor() # cursor = db.cursor()
cursor.execute(query=query_sql) # cursor.execute(query=query_sql)
results = cursor.fetchall() # results = cursor.fetchall()
print(results[0][4]) # print(results[0][4])
\ No newline at end of file \ No newline at end of file
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 sign in to comment