请问错在哪里?关于python操作mysql
请问错在哪里
import MySQLdb
conn=MySQLdb.Connect(
host='127.0.0.1',
port=3306,
user='root',
passwd='mm1988010928',
db='immoc',
charset='utf8'
)
cursor=conn.cursor
print conn
print cursor
cursor.close()
conn.close()
Traceback (most recent call last):
File "D:\Javapython\learnpysql\src\immoc\test_connection.py", line 14, in <module>
cursor.close()
AttributeError: 'function' object has no attribute 'close'