def selectSql(cls): """ :return: """ studentlist = [StudentListInfo.StudentList] students = [] data = cls.studentlist.selectSql() (studentlist) = data # 如C# 强制转换 ''' 也可以 sts=list(data) print(sts) for oo in sts: for nn in oo: print("nn",nn[1]) #print(data) ''' for obj in studentlist: for i in obj: students.append(StudentListInfo.StudentList(i[0],i[1],i[2],i[3])) return students def selectSqlOrder(cls, order: str)->list: """ 元组数据 :param order: studenName desc/asc :return: """ studentsorder = [StudentListInfo.StudentList] students=[] data = cls.studentlist.selectSqlOrder(order) (studentsorder) = data # 如C# 强制转换 ''' 也可以 for i in range(len(studentsorder)): print("rrr",type(studentsorder[i])) for duobj in studentsorder[i]: print(type(duobj)) print(duobj) ''' for obj in studentsorder: #print(type(obj)) for i in obj: students.append(StudentListInfo.StudentList(i[0], i[1], i[2], i[3])) return students
https://www.w3schools.com/python/python_tuples_unpack.asp
标签:obj,python,students,studentlist,Tuples,studentsorder,print,data,Loop From: https://www.cnblogs.com/geovindu/p/17494852.html