PyDocs

Nav

Data Persistence

Connection.cursor

  • Connection.cursor(factory=Cursor)
Return a cursor for the connection.
1 Example
>>> con.close()
>>> new_con = sqlite3.connect("tutorial.db")
>>> new_cur = new_con.cursor()
>>> res = new_cur.execute("SELECT title, year FROM movie ORDER BY score DESC")
>>> title, year = res.fetchone()
>>> print(f'The highest scoring Monty Python movie is {title!r}, released in {year}')
The highest scoring Monty Python movie is 'Monty Python and the Holy Grail', released in 1975
>>> new_con.close()
from the Python docs
See Also
No see-alsos for sqlite3/Connection.cursor
0 Notes
No notes for Connection.cursor