args = parser.parse_args()
Run GUI with:
def run(self, command): path = self.path_var.get() if not path: messagebox.showerror("Error", "Select a file or folder first") return # Call the CLI script script_dir = os.path.dirname(os.path.abspath(__file__)) script_path = os.path.join(script_dir, "mcpack_converter.py") cmd = [sys.executable, script_path, path, command] try: result = subprocess.run(cmd, capture_output=True, text=True) self.log.insert(tk.END, f"\n> {' '.join(cmd)}\n") self.log.insert(tk.END, result.stdout) if result.stderr: self.log.insert(tk.END, result.stderr) self.log.see(tk.END) except Exception as e: messagebox.showerror("Error", str(e)) if == " main ": root = tk.Tk() app = MCPackConverterGUI(root) root.mainloop() mcpack converter
mcpack_path = zip_path.with_suffix('.mcpack') zip_path.rename(mcpack_path) print(f"✅ Converted to: {mcpack_path}") return True def bulk_extract(directory): """Extract all .mcpack files in a directory""" directory = Path(directory) mcpack_files = list(directory.glob("*.mcpack")) if not mcpack_files: print("❌ No .mcpack files found") return args = parser
import tkinter as tk from tkinter import filedialog, messagebox, scrolledtext import subprocess import sys import os class MCPackConverterGUI: def (self, root): self.root = root root.title("MCPack Converter") root.geometry("600x400") "mcpack_converter.py") cmd = [sys.executable
zip_path = mcpack_path.with_suffix('.zip') mcpack_path.rename(zip_path) print(f"✅ Converted to: {zip_path}") return True def convert_to_mcpack(zip_path): """Rename .zip to .mcpack""" zip_path = Path(zip_path) if not zip_path.exists(): print(f"❌ File not found: {zip_path}") return False
# Extract a pack python mcpack_converter.py my_skin.mcpack --extract python mcpack_converter.py my_skin_extracted/ --pack Just rename to zip python mcpack_converter.py addon.mcpack --tozip Bulk extract all .mcpack in Downloads folder python mcpack_converter.py ~/Downloads --extract-all 6. Bonus: GUI version (Tkinter) Save as mcpack_gui.py :