pokequiz/Question.py
def randomLeader():
    """Creates and returns a random Leader object."""
    # Establish connection to SQLite database
    conn = sqlite3.connect(db, detect_types=sqlite3.PARSE_DECLTYPES)
    cur = conn.cursor()

    # Get random Gym Leader
    cur.execute('SELECT * FROM leaders ORDER BY RANDOM() LIMIT 1;')
    sel = cur.fetchone()

    # Close connection
    conn.close()

    return Leader(*sel)
Creates and returns a random Leader object.
Creates and returns a random Leader object.
Creates and returns a random Leader object .
def randomLeader():
    conn = sqlite3.connect(db, detect_types=sqlite3.PARSE_DECLTYPES)
    cur = conn.cursor()
    cur.execute('SELECT * FROM leaders ORDER BY RANDOM() LIMIT 1;')
    sel = cur.fetchone()
    conn.close()
    return Leader(*sel)
def randomLeader ( ) : conn = sqlite3 . connect ( db , detect_types = sqlite3 . PARSE_DECLTYPES ) cur = conn . cursor ( ) cur . execute ( 'SELECT * FROM leaders ORDER BY RANDOM() LIMIT 1;' ) sel = cur . fetchone ( ) conn . close ( ) return Leader ( * sel )
Creates and returns a random Leader object.
Creates and returns a random Leader object .
"""Creates and returns a random Leader object.""" # Establish connection to SQLite database # Get random Gym Leader # Close connection