Spaces:
Running
Running
Commit History
-
# space_allocator_final.py
Verified signatureimport tkinter as tk from tkinter import ttk, messagebox from PIL import Image, ImageTk import customtkinter as ctk import sys, os # ---------- Configuration ---------- DEFAULT_W = 600 DEFAULT_H = 250 WINDOW_W = 1200 WINDOW_H = 700 CANVAS_BG = "#0f1115" GLASS_BG = "#1b1d22" ACCENT = "#3b82f6" ANIMATION_FRAMES = 20 # ~0.4s # ---------- Helper function for PyInstaller ---------- def resource_path(relative_path): try: base_path = sys._MEIPASS except Exception: base_path = os.path.abspath(".") return os.path.join(base_path, relative_path) # ---------- Data ---------- class Item: def __init__(self, name, length, width): self.name = name self.length = float(length) self.width = float(width) self.area = self.length * self.width self.curr_x = 0 self.curr_y = 0 self.tag = name # ---------- Grid-based packing ---------- def grid_pack(items, container_w, container_h, cell_size=5): cols = max(1, int(…1dd531b -
initial commit
Verified signature273248e