Форум сайта python.su
Привет всем, пробую так:
не хочет!
import sqlite3
connection = sqlite3.connect("D:\\test\\test.db")
cursor = connection.cursor()
name = 'Anton'
surname = 'Ivanov'
age = 32
cursor.execute('CREATE TABLE IF NOT EXISTS people (first_name text, last_name text, age real)')
cursor.execute(f"INSERT INTO people VALUES ({name}, {surname}, {age})")
connection.commit()
cursor.execute('select * from people')
result = cursor.fetchall()
print(result)
cursor.close()
connection.close()
Офлайн