In myCxn.py: import MySQLdb cxn = MySQLdb.connect(host='localhost', db='test', user='root', passwd='admin' ) cur = cxn.cursor() In main.py ## import object from file from myCxn import cur, cxn cxn2 = cur.connection # pass the connection object from cursor # cxn2.close() # close() will cause cur.execute() fail... ## before execute() print "before execute():" print "description:", cur.description print "lastrowid:", cur.lastrowid # lastrowid => The id of last modified row. print "rowcount:", cur.rowcount cur.setoutputsizes(2) # seems not work, Does nothing, required by DB API. cur.execute("select * from test.t;") for data in cur.fetchall(): print("cur1_fetchall.rownumber:", cur.rownumber) print("cur1_fetchall.rowrowcount:", cur.rowcount) print(data[0]) cur.execute("select * from test.t;") for data in cur.fetchall(): print("cur2_fet...