Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pymysql.cursors
- connection = pymysql.connect(host='no',
- user='no',
- password='no',
- db='auth',
- charset='utf8mb4',
- cursorclass=pymysql.cursors.DictCursor)
- def read_guids(gm_file="gms.txt"):
- gm_list = []
- with open(gm_file, "r") as f:
- for guid in f.readlines():
- gm_list.append(guid.split(' ')[0])
- return gm_list
- gm_list = read_guids()
- try:
- with connection.cursor() as cursor:
- format_strings = ','.join(['%s'] * len(gm_list))
- sql = "UPDATE account SET points = points + 150 WHERE id IN (%s)"
- cursor.execute(sql % format_strings, tuple(gm_list))
- connection.commit()
- finally:
- connection.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement