diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 0000000..f315077 --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,9 @@ +{ + "permissions": { + "allow": [ + "Bash(python:*)" + ], + "deny": [], + "ask": [] + } +} diff --git a/README.md b/README.md index 36aec7c..d3ff5c1 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,17 @@ A Python GUI application for generating and playing interactive word search puzz ## Installation +### Option 1: Download Pre-built Application (Recommended) + +Download the pre-built application for your platform from the releases page: +- **Windows**: `WordSearch.exe` +- **macOS**: `WordSearch.app` +- **Linux**: `WordSearch` (executable) + +No installation required - just download and run! + +### Option 2: Run from Source + 1. Clone the repository: ```bash git clone https://git.firebugit.com/ksmith/WordSearch.git @@ -34,12 +45,19 @@ cd WordSearch 2. Install required dependencies: ```bash -pip install reportlab +pip install -r requirements.txt ``` ## Usage -Run the application: +### Running the Application + +**From pre-built executable:** +- **Windows**: Double-click `WordSearch.exe` +- **macOS**: Double-click `WordSearch.app` or run `open WordSearch.app` +- **Linux**: Run `./WordSearch` from terminal + +**From source:** ```bash python word_search_generator.py ``` @@ -86,6 +104,48 @@ python word_search_generator.py - ReportLab for PDF generation - Event-driven architecture for mouse interactions +## Building from Source + +To create standalone executables for distribution: + +### Prerequisites + +Install build dependencies: +```bash +pip install -r requirements.txt +``` + +### Building + +**Linux/macOS:** +```bash +./build.sh +``` + +**Windows:** +```cmd +build.bat +``` + +The built application will be in the `dist/` directory: +- **Linux**: `dist/WordSearch` +- **macOS**: `dist/WordSearch.app` +- **Windows**: `dist/WordSearch.exe` + +### Manual Build + +You can also build manually using PyInstaller: +```bash +pyinstaller word_search.spec +``` + +### Cross-Platform Notes + +- PyInstaller creates platform-specific executables +- Build on the target platform (Windows build requires Windows, etc.) +- macOS builds create an `.app` bundle +- Linux/Windows builds create a single executable file + ## License Created by Keith Smith diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..2d91fb0 --- /dev/null +++ b/build.bat @@ -0,0 +1,44 @@ +@echo off +REM Build script for Word Search application (Windows) + +echo ========================================= +echo Word Search Application Builder +echo ========================================= +echo. + +REM Check if PyInstaller is installed +pyinstaller --version >nul 2>&1 +if %errorlevel% neq 0 ( + echo PyInstaller not found. Installing dependencies... + pip install -r requirements.txt +) + +REM Clean previous builds +echo Cleaning previous builds... +if exist build rmdir /s /q build +if exist dist rmdir /s /q dist + +echo Building for platform: Windows +echo. + +REM Build the application +echo Running PyInstaller... +pyinstaller word_search.spec + +REM Check if build was successful +if exist dist ( + echo. + echo ========================================= + echo Build completed successfully! + echo ========================================= + echo. + echo Platform: Windows + echo Output location: dist\ + echo Executable: dist\WordSearch.exe + echo. + echo To run: dist\WordSearch.exe +) else ( + echo. + echo Build failed! Check the error messages above. + exit /b 1 +) diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..cd663c5 --- /dev/null +++ b/build.sh @@ -0,0 +1,70 @@ +#!/bin/bash +# Build script for Word Search application +# This script builds the application for the current platform + +echo "=========================================" +echo "Word Search Application Builder" +echo "=========================================" +echo "" + +# Check if PyInstaller is installed +if ! command -v pyinstaller &> /dev/null; then + echo "PyInstaller not found. Installing dependencies..." + pip install -r requirements.txt +fi + +# Clean previous builds +echo "Cleaning previous builds..." +rm -rf build dist + +# Detect platform +if [[ "$OSTYPE" == "linux-gnu"* ]]; then + PLATFORM="Linux" + OUTPUT_NAME="WordSearch" +elif [[ "$OSTYPE" == "darwin"* ]]; then + PLATFORM="macOS" + OUTPUT_NAME="WordSearch.app" +elif [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "win32" ]]; then + PLATFORM="Windows" + OUTPUT_NAME="WordSearch.exe" +else + PLATFORM="Unknown" + OUTPUT_NAME="WordSearch" +fi + +echo "Building for platform: $PLATFORM" +echo "" + +# Build the application +echo "Running PyInstaller..." +pyinstaller word_search.spec + +# Check if build was successful +if [ -d "dist" ]; then + echo "" + echo "=========================================" + echo "Build completed successfully!" + echo "=========================================" + echo "" + echo "Platform: $PLATFORM" + echo "Output location: dist/" + + if [[ "$PLATFORM" == "macOS" ]]; then + echo "Application: dist/WordSearch.app" + echo "" + echo "To run: open dist/WordSearch.app" + elif [[ "$PLATFORM" == "Linux" ]]; then + echo "Executable: dist/WordSearch" + echo "" + echo "To run: ./dist/WordSearch" + chmod +x dist/WordSearch + else + echo "Executable: dist/WordSearch.exe" + echo "" + echo "To run: dist\\WordSearch.exe" + fi +else + echo "" + echo "Build failed! Check the error messages above." + exit 1 +fi diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..476b941 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +reportlab>=4.0.0 +pyinstaller>=6.0.0 diff --git a/word_search.spec b/word_search.spec new file mode 100644 index 0000000..cf33f52 --- /dev/null +++ b/word_search.spec @@ -0,0 +1,51 @@ +# -*- mode: python ; coding: utf-8 -*- + +block_cipher = None + +a = Analysis( + ['word_search_generator.py'], + pathex=[], + binaries=[], + datas=[], + hiddenimports=[], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False, +) + +pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) + +exe = EXE( + pyz, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, + [], + name='WordSearch', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=False, # No console window + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, +) + +# macOS app bundle +app = BUNDLE( + exe, + name='WordSearch.app', + icon=None, + bundle_identifier='com.firebugit.wordsearch', +)