Answer the question
In order to leave comments, you need to log in
How to create table in db automatically in python?
There is a file with the names of groups in the university. I need to create as many tables as there are group names in the file. How to do this automatically in Python using sqlite3.
def init_db_groups(list_groups_name):
conn = get_connection()
c = conn.cursor()
if force:
c.execute('DROP TABLE IF EXISTS NAME_TABLE')
c.execute('''
CREATE TABLE IF NOT EXISTS NAME_TABLE(
id_stud INTEGER NOT NULL PRIMARY KEY,
number_zach INTEGER NOT NULL,
password INTEGER NOT NULL)
''')
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