Posts

Showing posts with the label Blogging App

Build a Simple Blog Application with Python and CustomTkinter

Image
Demo : Click Video ðŸ‘‡ðŸ‘‡ðŸ‘‡ Code : Libraries Required: cmd => pip install customtkinter import sqlite3 from tkinter import * from tkinter import messagebox import customtkinter as ctk # Database setup conn = sqlite3.connect('blog.db') cursor = conn.cursor() cursor.execute(''' CREATE TABLE IF NOT EXISTS posts (     id INTEGER PRIMARY KEY AUTOINCREMENT,     title TEXT NOT NULL,     content TEXT NOT NULL,     created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ); ''') conn.commit() # Functions def create_post():     title = title_entry.get()     content = content_entry.get("1.0", "end-1c")          if title and content:         cursor.execute("INSERT INTO posts (title, content) VALUES (?, ?)", (title, content))         conn.commit()         messagebox.showinfo("Success", "Post created successfully!")         title_entry.delete...