Beispiel #1
0
def create_player(cursor, player: Player):
    cursor.execute(
        "INSERT INTO Player (id, name, rating) VALUES ('{}', '{}', {});".
        format(player.get_id(), player.get_name(), player.get_rating()))
    cursor.execute(
        "INSERT INTO Player (id, name, rating) VALUES ('{}(nd)', '{}(nd)', {});"
        .format(player.get_id(), player.get_name(), player.get_rating()))
Beispiel #2
0
from models import Player
from initialization import init_app

if __name__ == '__main__':
    init_app()

    player_1 = Player(name='Diane', age=30)
    player_1.get_name()
    player_1.get_age_in_cat_live()