🔥 The Ultimate FREE Code Editor in 2025 - Supports Python, C++, Java, HTML, JS & More!

 Demo :


Click Video 👇👇👇




















🌟 Features :

  • Free download

  • Multi-language support

  • Custom UI (Dark mode)

  • Word wrap + file explorer

  • Output box with scrollbar

  • One-click run for Python/C++/Java


Code :


import customtkinter as ctk

from tkinter import filedialog, messagebox

import subprocess

import os

import glob


# Setup

ctk.set_appearance_mode("dark")

ctk.set_default_color_theme("dark-blue")


app = ctk.CTk()

# app.geometry("1000x600")

app.geometry("700x750")

app.title("Fuzzu Code Editor 1.1v")


# Header

header = ctk.CTkLabel(app, text="Fuzzu Code Editor 1.1v - More Features Coming Soon with New Version", font=("Arial", 18, "bold"))

header.pack(pady=(5, 0))


# --- Scrollable Toolbar (Horizontal) ---

toolbar_frame = ctk.CTkFrame(app)

toolbar_frame.pack(fill="x", padx=10, pady=(5, 0))


canvas = ctk.CTkCanvas(toolbar_frame, height=50, bg="#2b2b2b", highlightthickness=0)

canvas.pack(side="top", fill="x", expand=True)


scrollbar_x = ctk.CTkScrollbar(toolbar_frame, orientation="horizontal", command=canvas.xview)

scrollbar_x.pack(side="bottom", fill="x")


canvas.configure(xscrollcommand=scrollbar_x.set)


btn_frame = ctk.CTkFrame(canvas)

canvas.create_window((0, 0), window=btn_frame, anchor="nw")


def update_scrollregion(event):

    canvas.configure(scrollregion=canvas.bbox("all"))


btn_frame.bind("<Configure>", update_scrollregion)


# Word wrap toggle state

wrap_state = {"enabled": False}


def toggle_wrap():

    wrap_state["enabled"] = not wrap_state["enabled"]

    text_editor.configure(wrap="word" if wrap_state["enabled"] else "none")

    wrap_button.configure(text="🔁 Word Wrap: On" if wrap_state["enabled"] else "🔁 Word Wrap: Off")


# Main Frame: Explorer + Editor

main_frame = ctk.CTkFrame(app)

main_frame.pack(fill="both", expand=True, padx=10, pady=(5, 5))


# File Explorer

explorer = ctk.CTkFrame(main_frame, width=200)

explorer.pack(side="left", fill="y", padx=(0, 5), pady=5)

explorer.pack_propagate(False)


# Editor Frame

editor_frame = ctk.CTkFrame(main_frame)

editor_frame.pack(side="right", fill="both", expand=True)


# --- Code Editor with Scrollbar ---

text_scroll_frame = ctk.CTkFrame(editor_frame)

text_scroll_frame.pack(fill="both", expand=True)


text_editor = ctk.CTkTextbox(text_scroll_frame, font=("Consolas", 14), wrap="none")

text_editor.pack(side="left", fill="both", expand=True)


editor_scroll = ctk.CTkScrollbar(text_scroll_frame, orientation="vertical", command=text_editor.yview)

editor_scroll.pack(side="right", fill="y")


text_editor.configure(yscrollcommand=editor_scroll.set)


# Output Frame (bottom)

output_frame = ctk.CTkFrame(app)

output_frame.pack(fill="x", padx=10, pady=(0, 10))


output_label = ctk.CTkLabel(output_frame, text="🔽 Output", anchor="w")

output_label.pack(fill="x")


# --- Output Box with Scrollbar ---

output_scroll_frame = ctk.CTkFrame(output_frame)

output_scroll_frame.pack(fill="x")


output_box = ctk.CTkTextbox(output_scroll_frame, height=100, font=("Consolas", 12), wrap="word")

output_box.pack(side="left", fill="x", expand=True)


output_scroll = ctk.CTkScrollbar(output_scroll_frame, orientation="vertical", command=output_box.yview)

output_scroll.pack(side="right", fill="y")


output_box.configure(yscrollcommand=output_scroll.set)


# Variables

selected_folder = ""

current_file = ctk.StringVar()


# Load Files

def load_files():

    for widget in explorer.winfo_children():

        widget.destroy()

    if selected_folder:

        for ext in ("*.py", "*.html", "*.js", "*.css", "*.c", "*.cpp", "*.java"):

            for file in glob.glob(os.path.join(selected_folder, ext)):

                ctk.CTkButton(explorer, text=os.path.basename(file), command=lambda f=file: open_file(f)).pack(pady=2, padx=5, fill="x")


# Folder Functions

def select_folder():

    global selected_folder

    folder = filedialog.askdirectory()

    if folder:

        selected_folder = folder

        load_files()


def new_folder():

    global selected_folder

    folder = filedialog.askdirectory()

    if folder:

        name = filedialog.asksaveasfilename(initialdir=folder, title="New Folder", initialfile="NewFolder")

        if name:

            os.makedirs(name, exist_ok=True)

            selected_folder = name

            load_files()


# File Functions

def open_file(path=None):

    if not path:

        path = filedialog.askopenfilename()

    if path:

        with open(path, 'r', encoding="utf-8") as f:

            code = f.read()

        text_editor.delete("1.0", "end")

        text_editor.insert("1.0", code)

        current_file.set(path)


def new_file():

    if not selected_folder:

        messagebox.showinfo("Select Folder", "Please select a folder first.")

        return

    file_path = filedialog.asksaveasfilename(initialdir=selected_folder, defaultextension=".py",

        filetypes=[

            ("Python Files", "*.py"),

            ("HTML Files", "*.html"),

            ("JavaScript Files", "*.js"),

            ("CSS Files", "*.css"),

            ("C Files", "*.c"),

            ("C++ Files", "*.cpp"),

            ("Java Files", "*.java"),

        ])

    if file_path:

        with open(file_path, 'w', encoding='utf-8') as f:

            f.write("")

        open_file(file_path)

        load_files()


def save_file():

    file = current_file.get()

    if not file:

        file = filedialog.asksaveasfilename(defaultextension=".txt")

        current_file.set(file)

    if file:

        with open(file, 'w', encoding='utf-8') as f:

            f.write(text_editor.get("1.0", "end"))


# Run Code Function

def run_code():

    file = current_file.get()

    if not file:

        messagebox.showerror("Error", "No file open to run.")

        return


    ext = os.path.splitext(file)[1]

    code = text_editor.get("1.0", "end")

    temp_file = "temp_code" + ext


    with open(temp_file, "w", encoding="utf-8") as f:

        f.write(code)


    output_box.delete("1.0", "end")


    try:

        if ext == ".py":

            result = subprocess.run(["python", temp_file], capture_output=True, text=True)

        elif ext == ".js":

            result = subprocess.run(["node", temp_file], capture_output=True, text=True, shell=True)

        elif ext == ".html":

            os.system(f"start {temp_file}")

            result = None

        elif ext == ".css":

            messagebox.showinfo("Run Info", "CSS cannot be run directly.")

            result = None

        elif ext == ".c":

            subprocess.run(f"gcc {temp_file} -o temp_c", shell=True)

            result = subprocess.run("temp_c", shell=True, capture_output=True, text=True)

        elif ext == ".cpp":

            subprocess.run(f"g++ {temp_file} -o temp_cpp", shell=True)

            result = subprocess.run("temp_cpp", shell=True, capture_output=True, text=True)

        elif ext == ".java":

            with open("Temp.java", "w", encoding="utf-8") as f:

                f.write(code)

            subprocess.run("javac Temp.java", shell=True)

            result = subprocess.run("java Temp", shell=True, capture_output=True, text=True)

        else:

            output_box.insert("end", "❌ Unsupported file type.")

            return


        if result:

            output_box.insert("end", result.stdout + "\n" + result.stderr)


    except Exception as e:

        output_box.insert("end", f"❌ Error: {str(e)}")


# Buttons

buttons = [

    ("📁 Select Folder", select_folder),

    ("📂 New Folder", new_folder),

    ("🆕 New File", new_file),

    ("📂 Open File", open_file),

    ("💾 Save", save_file),

    ("▶ Run Code", run_code),

    ("🔁 Word Wrap: Off", toggle_wrap)

]


for text, command in buttons:

    btn = ctk.CTkButton(btn_frame, text=text, command=command)

    btn.pack(side="left", padx=5, pady=5)

    if "Wrap" in text:

        wrap_button = btn


app.mainloop()

Comments

Popular posts from this blog

🚀 Simple Login & Registration System in Python Tkinter 📱

🔥 Advanced MP3 Music Player in Python | CustomTkinter + Pygame | Free Source Code

🚀 Create a Python Screen Recorder with Audio (Complete Code)