Commit 2898159d by larosa

add test

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