import mysql.connector
cnx= mysql.connector.connect(user='root',password='',
host='127.0.0.1',
database='mysql')
cursor=cnx.cursor()
query= 'SELECT * from colgs'
cursor.execute(query)
people=[]
for (name,weight,height) in cursor:
people.append((name,weight,height))
people.sort (key= lambda x:(-x[2],x[1]) )
for i in people:
print (i[0],i[1],i[2])
cnx.close()
bash برای rename کردن زیرنویس ها
cursor ,i ,people ,x ,cnx ,mysql ,weight height ,name weight ,mysql connector ,1 for ,2 x ,name weight height
درباره این سایت