Skip to main content
Shed Skin provides a command-line interface for translating, building, and running Python programs compiled to C++.

Available Commands

Shed Skin offers the following subcommands:
  • build - Translate and build Python module using CMake (recommended)
  • translate - Translate Python module to C++ with Makefile generation
  • run - Translate, build, and run the module in one step
  • analyze - Analyze and validate Python module without code generation
  • runtests - Run the Shed Skin test suite

Basic Usage

shedskin <command> [options] <module.py>
If no command is specified, translate is used by default:
# These are equivalent
shedskin myprogram.py
shedskin translate myprogram.py

Quick Start Examples

Build an executable

shedskin build myprogram.py
This will:
  1. Analyze your Python code
  2. Generate C++ source files
  3. Create CMake build configuration
  4. Compile to an executable in build/

Build and run immediately

shedskin run myprogram.py

Generate an extension module

shedskin build --extmod mymodule.py
This creates a Python extension module that can be imported from regular Python.

Translate to C++ only

shedskin translate myprogram.py
Generates C++ files and Makefile without compiling.

Common Options

These options work with most commands:
-o, --outputdir
string
Specify output directory for generated files (default: current directory)
-e, --extmod
boolean
Generate a Python extension module instead of a standalone executable
-b, --nobounds
boolean
Disable bounds checking for better performance
-w, --nowrap
boolean
Disable wrap-around checking for negative indices
-s, --silent
boolean
Silent mode - only show warnings
-d, --debug
integer
Set debug level (1-3). Level 3 enables detailed iterative flow analysis logging

Workflow Comparison

# Modern build system with better dependency management
shedskin build myprogram.py
./build/myprogram

Makefile Workflow (Traditional)

# Generates Makefile for manual compilation
shedskin translate myprogram.py
make
./myprogram

Output Structure

After compilation, Shed Skin creates:
project/
├── myprogram.py          # Your source file
├── myprogram.cpp         # Generated C++ implementation
├── myprogram.hpp         # Generated C++ header
├── build/                # CMake build directory
│   └── myprogram         # Compiled executable
└── Makefile              # Generated makefile (translate command)

Getting Help

For detailed information on any command:
shedskin --help
shedskin build --help
shedskin translate --help

Version Information

Shed Skin displays version and copyright information on startup:
*** SHED SKIN Python-to-C++ Compiler 0.9.12 ***
Copyright 2005-2026 Mark Dufour and contributors; License GNU GPL version 3

Python Version Requirements

Shed Skin supports Python 3.8 through 3.14. The compiler will exit with an error if run with an unsupported Python version.

Next Steps