Introduction
The Windows Python Launcher uses a simple configuration system built directly into the batch script. All configuration options are defined as environment variables at the top of thePythonLauncher.bat file.
How to Configure
To customize the launcher for your project:- Open
PythonLauncher.batin a text editor - Locate the Configuration section (lines 6-36)
- Modify the
setstatements to change configuration values - Save the file
No restart or reload is required - changes take effect immediately the next time you run the launcher.
Configuration Structure
All configuration options follow this syntax:Example Configuration Section
Configuration Categories
The configuration options are organized into three main categories:Python Setup
Controls which Python interpreter is used and how it’s located.pythonversion- Specify Python version (e.g., 3.11, 3.10)pythondir- Path to Python executable or launcher command
Virtual Environment
Manages automatic virtual environment creation and package installation.usevenv- Enable/disable virtual environment usagevenvname- Name of the virtual environment directoryinstallrequirementsfile- Auto-install dependenciesrequirementsfile- Path to requirements file
Window Options
Customizes the command window behavior and appearance.windowname- Title displayed in the windowminimizedcmd- Start window minimizedautoclosecmd- Auto-close when script finishespassarguments- Forward arguments to Python scriptalertifpynotinstalled- Show alert if Python is missing
Boolean Values
File Detection
The launcher includes an auto-detection feature for initial Python files:File names in the
initialfiles list must be enclosed in double quotes and separated by spaces.Best Practices
Project-Specific Configuration
CopyPythonLauncher.bat into each project directory and configure it specifically for that project’s needs. This allows different projects to have different:
- Python versions
- Virtual environment settings
- Window behaviors
Version Control
Consider addingPythonLauncher.bat to your version control system so team members share the same configuration.
Comments
The batch file uses double colons (::) for comments. Add your own comments to document project-specific settings:
Relative vs Absolute Paths
When specifying paths in configuration values, you can use:- Relative paths: Use
%cd%\path\to\fileto reference locations relative to the launcher - Absolute paths: Use full paths like
C:\Python\python.exe
Next Steps
Explore the detailed documentation for each configuration category:- Python Setup - Configure Python interpreter selection
- Virtual Environment - Set up automatic venv management
- Window Options - Customize window behavior