Answer the question
In order to leave comments, you need to log in
SQLite3 - Why is the table not displayed?
See my code:
import sqlite3
import time
import random
conn = sqlite3.connect("db.db") # или :memory: чтобы сохранить в RAM
cursor = conn.cursor()
# Создание таблицы
cursor.execute("""CREATE TABLE IF not exists player(
name text,
id text,
race text
)""")
conn.commit()
def playerData(returning="n"):
if returning == "n":
eName = input("name, please - ")
eId = str((random.randint(1000000000000, 100000000000000000000)))
eRace = input("race, please - ")
playerData = [(eName, eId, eRace), ("Georgy", "001", "Orc")] # тут я перепробовал триллион возможных вариантов скобок и их расположения..
cursor.executemany("INSERT INTO player VALUES (?,?,?)", playerData)
conn.commit()
elif returning == "y":
eName = input("name, please - ")
eId = str((random.randint(1000000000000, 100000000000000000000)))
eRace = input("race, please - ")
playerData = [(eName, eId, eRace), ("Georgy", "001", "Orc")] # тут я перепробовал триллион возможных вариантов скобок и их расположения..
cursor.executemany("INSERT INTO player VALUES (?,?,?)", playerData)
conn.commit()
return print(cursor.fetchall())
playerData("y")
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question