πŸ”₯ Generate Viral Instagram Captions with openai – Python GUI App (Offline Tool) | FuzzuTech

 Demo :


Click Video πŸ‘‡πŸ‘‡πŸ‘‡






















Features:

  • YouTube embedded short

  • Code snippet screenshot (main window)

  • Button: “Download Python Code” (optional link to GitHub/GDrive)

  • SEO Meta: Python GUI Caption Tool, AI Instagram Caption Generator, Offline Caption App


Code :


import tkinter as tk

import customtkinter as ctk

import random

# import openai  # Uncomment this line if you want to use OpenAI


# openai.api_key = "your-api-key"  # Add your OpenAI API key here if needed


# Predefined topic-based captions (fallback)

captions = {

    "travel": [

        "Wander often, wonder always 🌍✈️",

        "Collecting memories, not things ✨",

        "New places, new faces πŸŒ„πŸ“Έ"

    ],

    "food": [

        "Foodie vibes only πŸ”πŸ•",

        "Good food = Good mood πŸ˜‹",

        "In a serious relationship with food ❤️"

    ],

    "gym": [

        "Sweat now, shine later πŸ’ͺπŸ”₯",

        "No pain, no gain πŸ‹️‍♂️",

        "Train insane or remain the same πŸ†"

    ],

    "love": [

        "Love is the only magic I believe in πŸ’–✨",

        "Falling in love with every moment πŸ’ž",

        "You + Me = ❤️"

    ],

    "fashion": [

        "Style is a way to say who you are πŸ‘—πŸ”₯",

        "Slaying every outfit, every day πŸ’ƒπŸ•Ί",

        "OOTD goals πŸ’«πŸ‘ "

    ],

    "default": [

        "Living my best life 😎",

        "Caption this πŸ€”πŸ’­",

        "Smile. Sparkle. Shine ✨"

    ]

}


# Caption generator (fallback)

def generate_caption(prompt):

    topic = prompt.lower()

    selected = captions.get(topic, captions["default"])

    return random.choice(selected)


# OpenAI version (optional – disabled)

'''

def generate_caption(prompt):

    try:

        response = openai.Completion.create(

            engine="text-davinci-003",

            prompt=f"Generate an Instagram caption for: {prompt}",

            max_tokens=60,

            temperature=0.9

        )

        return response.choices[0].text.strip()

    except Exception as e:

        return "Error: " + str(e)

'''


# GUI setup

ctk.set_appearance_mode("dark")

ctk.set_default_color_theme("green")


app = ctk.CTk()

app.title("Instagram Caption Generator")

app.geometry("500x500")

app.resizable(False, False)


ctk.CTkLabel(app, text="Instagram Caption Generator", font=("Arial Bold", 22)).pack(pady=20)


entry = ctk.CTkEntry(app, placeholder_text="Enter topic (e.g. travel, food, gym)", width=400)

entry.pack(pady=10)


output = ctk.CTkTextbox(app, width=450, height=150, font=("Arial", 14), wrap="word")

output.pack(pady=10)

output.insert("1.0", "Your caption will appear here...")

output.configure(state="disabled")


def on_generate():

    topic = entry.get().strip()

    caption = generate_caption(topic)

    output.configure(state="normal")

    output.delete("1.0", tk.END)

    output.insert("1.0", caption)

    output.configure(state="disabled")


ctk.CTkButton(app, text="Generate Caption", command=on_generate, width=200).pack(pady=15)


ctk.CTkLabel(app, text="Made by FuzzuTech", font=("Arial", 12)).pack(pady=10)


app.mainloop()

Comments

Popular posts from this blog

πŸš€ Simple Login & Registration System in Python Tkinter πŸ“±

πŸš€ Create a Python Screen Recorder with Audio (Complete Code)

Python IP Tracker App with GUI | Track IP Location Real-Time! (Working Project)