Did I find the right examples for you? yes no

All Samples(903)  |  Call(901)  |  Derive(0)  |  Import(2)
connect(database[, timeout, isolation_level, detect_types, factory])

Opens a connection to the SQLite database file *database*. You can use
":memory:" to open a database connection to a database that resides in
RAM instead of on disk.

src/1/c/1Channel-HEAD/default.py   1Channel(Download)
def init_database():
    _1CH.log('Building PrimeWire Database')
    if DB == 'mysql':
        db = orm.connect(database=DB_NAME, user=DB_USER, password=DB_PASS, host=DB_ADDR, buffered=True)
        cur = db.cursor()
        	try: xbmcvfs.mkdirs(os.path.dirname(DB_DIR))
        	except: os.path.mkdir(os.path.dirname(DB_DIR))
        db = orm.connect(DB_DIR)
        db.execute('CREATE TABLE IF NOT EXISTS seasons (season UNIQUE, contents)')
        db.execute('CREATE TABLE IF NOT EXISTS favorites (type, name, url, year)')
        statement = 'INSERT INTO favorites (type, name, url, year) VALUES (%s,%s,%s,%s)'
        if DB == 'mysql':
            db = orm.connect(database=DB_NAME, user=DB_USER, password=DB_PASS, host=DB_ADDR, buffered=True)
        else:
            db = orm.connect(DB_DIR)
        sql_del = 'DELETE FROM favorites WHERE type=%s AND name=%s AND url=%s'
        if DB == 'mysql':
            db = orm.connect(database=DB_NAME, user=DB_USER, password=DB_PASS, host=DB_ADDR, buffered=True)
        else:
            db = orm.connect(DB_DIR)

src/h/u/hue-HEAD/desktop/core/ext-py/pysqlite/doc/includes/sqlite3/apsw_example.py   hue(Download)
 
# Create pysqlite connection from APSW connection
con = sqlite3.connect(apsw_con)
result = con.execute("select times_two(15)").fetchone()[0]
assert result == 30

src/h/o/hortonworks-sandbox-HEAD/desktop/core/ext-py/pysqlite/doc/includes/sqlite3/apsw_example.py   hortonworks-sandbox(Download)
 
# Create pysqlite connection from APSW connection
con = sqlite3.connect(apsw_con)
result = con.execute("select times_two(15)").fetchone()[0]
assert result == 30

src/p/y/pysqlite-2.6.3/doc/includes/sqlite3/apsw_example.py   pysqlite(Download)
 
# Create pysqlite connection from APSW connection
con = sqlite3.connect(apsw_con)
result = con.execute("select times_two(15)").fetchone()[0]
assert result == 30

src/a/d/adhocracy-pysqlite-2.6.3/doc/includes/sqlite3/apsw_example.py   adhocracy-pysqlite(Download)
 
# Create pysqlite connection from APSW connection
con = sqlite3.connect(apsw_con)
result = con.execute("select times_two(15)").fetchone()[0]
assert result == 30

src/p/y/python-code-snippets-HEAD/CodeSnippets/PyDown/trunk/PyDown/database.py   python-code-snippets(Download)
                self.conn = WrappedConnection(
                    dbapi.connect(
                        host    = host,
                        user    = username,
                        passwd  = password,
            try:
                self.conn = WrappedConnection(
                    dbapi.connect(self.databasename),
                    placeholder = self.placeholder,
                    prefix = self.tableprefix

src/p/y/pyspatialite-3.0.1-alpha-0/doc/includes/sqlite3/apsw_example.py   pyspatialite(Download)
 
# Create pysqlite connection from APSW connection
con = sqlite3.connect(apsw_con)
result = con.execute("select times_two(15)").fetchone()[0]
assert result == 30

src/w/i/winappdbg-1.5/examples/miscellaneous/02_memory_dump.py   winappdbg(Download)
 
        # Connect to the database and get a cursor.
        database = sqlite.connect(dbfile)
        cursor   = database.cursor()
 

src/p/y/pydanny-event-notes-HEAD/Pycon2009/internet/examples/ch21/alt/ushuffle_dbPRE25.py   pydanny-event-notes(Download)
        if not os.path.isdir(dbDir):
            os.mkdir(dbDir)
        cxn = sqlite3.connect(os.path.join(dbDir, dbName))
 
    elif db == 'mysql':

src/p/y/pydanny-event-notes-HEAD/Pycon2009/internet/examples/ch21/ushuffle_db.py   pydanny-event-notes(Download)
        if not os.path.isdir(dbDir):
            os.mkdir(dbDir)
        cxn = sqlite3.connect(os.path.join(dbDir, dbName))
 
    elif db == 'mysql':

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next