Commit 2898159d by larosa

add test

parent 5bdf6cfd
Showing with 17 additions and 7 deletions
import redis
import pymysql
config_prod = {
"mysql": {
......@@ -17,10 +18,19 @@ 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__':
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)
\ No newline at end of file
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"])
cursor = db.cursor()
cursor.execute(query=query_sql)
results = cursor.fetchall()
print(results[0][4])
\ 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