SHARE
TWEET

Untitled

a guest Nov 15th, 2012 33 Never
  1. con=MySQLdb.connect(host='localhost', user='test', passwd='xx', db='yy')
  2. curs = con.cursor(MySQLdb.cursors.CursorUseResultMixIn)
  3.        
  4. File "C:Python26libsite-packagesMySQLdbconnections.py", line 226, in cursor
  5.     return (cursorclass or self.cursorclass)(self)
  6. TypeError: object.__new__() takes no parameters
  7.        
  8. class SSCursor(CursorUseResultMixIn, CursorTupleRowsMixIn,
  9.                BaseCursor):
  10.  
  11.     """This is a Cursor class that returns rows as tuples and stores
  12.     the result set in the server."""
  13.        
  14. import MySQLdb.cursors as cursors
  15. con = MySQLdb.connect(host = 'localhost', user = 'test', passwd = 'xx',
  16.                            db = 'yy', cursorclass = cursors.SSCursor)
RAW Paste Data
Top