반응형 DB1 [파이썬] SQLite DB를 만들고 검색해보자! 데이터베이스 import sqlite3 # Function to create a new database def create_database(): # Connect to or create the database file conn = sqlite3.connect('example.db') # Create a cursor object to interact with the database cursor = conn.cursor() # Create a table cursor.execute('''CREATE TABLE IF NOT EXISTS records (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, age INTEGER)''') # Commit the changes and close .. 2023. 5. 22. 이전 1 다음 반응형