¡@

Home 

python Programming Glossary: conn.cursor

Why is SQLAlchemy insert with sqlite 25 times slower than using sqlite3 directly?

http://stackoverflow.com/questions/11769366/why-is-sqlalchemy-insert-with-sqlite-25-times-slower-than-using-sqlite3-directly

secs def init_sqlite3 dbname conn sqlite3.connect dbname c conn.cursor c.execute DROP TABLE IF EXISTS customer c.execute CREATE TABLE.. n 100000 dbname 'sqlite3.db' conn init_sqlite3 dbname c conn.cursor t0 time.time for i in range n row 'NAME ' str i c.execute INSERT.. secs def init_sqlite3 dbname conn sqlite3.connect dbname c conn.cursor c.execute DROP TABLE IF EXISTS customer c.execute CREATE TABLE..

How to extract information from ODP accurately? [closed]

http://stackoverflow.com/questions/16355421/how-to-extract-information-from-odp-accurately

' path to database' # create table with conn cursor conn.cursor cursor.execute ''' CREATE TABLE IF NOT EXISTS odp_urls url text.. gzip.open 'content.rdf.u8.gz' 'rb' as content conn cursor conn.cursor for event element in ET.iterparse content tag ' http dmoz.org..

How to delete a row from a listbox in TKinter and SQLite3

http://stackoverflow.com/questions/19738499/how-to-delete-a-row-from-a-listbox-in-tkinter-and-sqlite3

0 END conn sqlite3.connect 'phonebook1.db' c conn.cursor conn.execute ''' CREATE TABLE IF NOT EXISTS people name TEXT.. def del_notes self conn sqlite3.connect 'phonebook1.db' c conn.cursor list c.execute SELECT FROM people conn.commit for row in list.. database self.conn sqlite3.connect 'phonebook1.db' c self.conn.cursor # create table c.execute '''CREATE TABLE IF NOT EXISTS people..

How to enable MySQL client auto re-connect with MySQLdb?

http://stackoverflow.com/questions/207981/how-to-enable-mysql-client-auto-re-connect-with-mysqldb

exception. The other example above implies that it is the conn.cursor method that throws this exception. import MySQLdb class DB conn.. MySQLdb.connect def query self sql try cursor self.conn.cursor cursor.execute sql except AttributeError MySQLdb.OperationalError.. MySQLdb.OperationalError self.connect cursor self.conn.cursor cursor.execute sql return cursor db DB sql SELECT FROM foo cur..

How to get a row-by-row MySQL ResultSet in python

http://stackoverflow.com/questions/337479/how-to-get-a-row-by-row-mysql-resultset-in-python

rows at a time like this start_row 0 while True cursor conn.cursor cursor.execute SELECT item FROM items LIMIT d 1000 start_row.. conn MySQLdb.connect user user passwd password db mydb cur conn.cursor print Executing query cur.execute SELECT FROM bigtable print..

python adds “E” to string

http://stackoverflow.com/questions/3382234/python-adds-e-to-string

user adminuser password adminpass host host cur conn.cursor #user and pw are simple standard python strings the function..

Merge SQLite files into one db file, and 'begin/commit' question

http://stackoverflow.com/questions/3689694/merge-sqlite-files-into-one-db-file-and-begin-commit-question

anway import sqlite3 conn sqlite3.connect ' memory ' cur conn.cursor cur.execute 'begin' sqlite3.Cursor object at 0x0104B020 cur.execute..

SQLite date storage and conversion

http://stackoverflow.com/questions/4272908/sqlite-date-storage-and-conversion

' memory ' detect_types sqlite3.PARSE_DECLTYPES cur conn.cursor cur.execute 'CREATE TABLE foo bar DATE ' # Unfortunately this..

is there a pythonic way to try something up to a maximum number of times?

http://stackoverflow.com/questions/567622/is-there-a-pythonic-way-to-try-something-up-to-a-maximum-number-of-times

conn MySQLdb.connect host user password database cursor conn.cursor try cursor.execute query rows cursor.fetchall for row in rows.. conn MySQLdb.connect host user password database cursor conn.cursor attempts 0 while attempts 3 try cursor.execute query rows cursor.fetchall..

Writing UTF-8 String to MySQL with Python

http://stackoverflow.com/questions/6202726/writing-utf-8-string-to-mysql-with-python

'M xc3 xbcller' name data_from_ldap.decode 'utf8' cursor conn.cursor cursor.execute u INSERT INTO mytable SET name s name You may..

SQLite Performance Benchmark — why is :memory: so slow…only 1.5X as fast as disk?

http://stackoverflow.com/questions/764710/sqlite-performance-benchmark-why-is-memory-so-slow-only-1-5x-as-fast-as-d

import sqlite3 import numpy as np def load_mat conn mat c conn.cursor #Try to avoid hitting disk trading safety for speed. #http stackoverflow.com..

Use binary COPY table FROM with psycopg2

http://stackoverflow.com/questions/8144002/use-binary-copy-table-from-with-psycopg2

conn psycopg2.connect dbname mydb user postgres curs conn.cursor # Convert floating point numbers to text write to COPY input.. conn psycopg2.connect dbname mydb user postgres curs conn.cursor # Determine starting value for sequence curs.execute SELECT.. conn psycopg2.connect dbname mydb user postgres curs conn.cursor # NumPy record array shape 7 2000 500 print 'Generating data..