import os
currentPath = os.path.dirname(__file__)
abc = "pyti"
path = os.path.join(currentPath, abc)
while True:
path = input('Новый путь: ')
abc = path
connect = pymysql.connect(host='localhost', user='root', password='root', db='dsbot', cursorclass=pymysql.cursors.DictCursor)
try:
with connect.cursor() as cursor:
cursor.execute(f"SELECT * FROM MyTable WHERE user_id={user_id}")
row = cursor.fetchone
print(row)
finally:
connect.close()