首页 技术教程 实用代码 注册破解 正则表达式 网址导航 电子书籍

用python编写一个记事本程序,sqlite作为数据库

import tkinter as tk import sqlite3 from tkinter import messagebox from datetime import datetime # 创建数据库连接 conn = sqlite3.connect('notes.db') cursor = conn.cursor() # 创建notes表格 cursor.execute(''' CREATE TABLE IF NOT EXISTS notes ( id INTEGER PRIMARY KEY AUTOINCREMENT, content TEXT NOT NULL, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ) ''') conn.commit() def save_note(): content = text.get("1.0", tk.END) if content.str...
类别:程序开发 - Python    查看:204    更新:2023-12-15