The return of the function must be written in a key place. Can't scribbleDo you understand the difference between the following two groups?Can only return before the end of the taskconn=MySQLdb.connect(**connection) cur=conn.cursor() cur.execute(sql) results=cur.fetchall() conn.cursor().close() conn.commit() conn.close() return results 和 conn=MySQLdb.connect(**connection) cur=conn.cursor() cur.execute(sql) results=cur.fetchall() return results conn.cursor().close() conn.commit() conn.close()
python return
Guess you like
Origin blog.csdn.net/huochuangchuang/article/details/49429685
Recommended
Ranking