pywinpty
Pseudo terminal support for Windows from Python.
What it is and what it does
PyWinpty is a Python wrapper around Windows pseudoterminal functionality, enabling applications to spawn and interact with console processes as if they were running in a terminal. It supports both the modern ConPTY interface and the legacy winpty library, abstracting away the complexity of Windows console I/O pipes. The package provides two usage levels: a high-level PtyProcess class for common spawning tasks, and a low-level PTY object for fine-grained control over process lifecycle, resizing, and I/O.
The package is compiled from Rust using PyO3 and Maturin, with prebuilt wheels available for Windows on x86_64 and ARM64 architectures across Python 3.10 through 3.14. It has no runtime dependencies, making it lightweight once installed. Active maintenance and permissive licensing make it suitable for both open-source and proprietary Windows terminal emulators, shells, and IDE integrations.
Use it for:
- Build terminal emulators or shell frontends on Windows that spawn and manage interactive console applications.
- Implement IDE or editor integrations that need to run and capture output from Windows console tools and scripts.
- Create testing frameworks that spawn and interact with command-line programs on Windows systems.
- Develop remote terminal or SSH-like tools that require pseudoterminal support on Windows.
- Build automation scripts that need to interact with interactive console applications via stdin/stdout.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
PyWinpty creates and manages pseudoterminals on Windows, allowing Python to spawn and communicate with console processes via ConPTY or the winpty library.
Yes, if you are developing on Windows and need to spawn and interact with console processes programmatically. The package is actively maintained, has no runtime dependencies, carries a permissive license, and is stable (Production/Stable status). Install friction is moderate due to platform and Python version specificity, but prebuilt wheels are available for common configurations. No known vulnerabilities.
Install
pywinpty on PyPI
pip
pip install pywinptyuv
uv add pywinptypoetry
poetry add pywinptyInstalling pywinpty
Before you install
Medium install friction due to compiled wheels for Windows only (x86_64 and ARM64, Python 3.10–3.14). Active maintenance with recent release; no runtime dependencies simplifies deployment once installed.
License in practice
Permissive license allows use in proprietary and open-source projects without copyleft obligations.
Quickstart
pip install pywinpty
from pywinpty import PtyProcess
proc = PtyProcess.spawn('python')
proc.write('print("hello")\r\n')
while proc.isalive():
print(proc.readline())
Windows only; requires Python 3.10 or later.
Verify before relying
- Whether prebuilt wheels cover all intended deployment targets and Python patch versions.
- Performance characteristics when spawning or managing many concurrent processes.
- Compatibility with Windows Subsystem for Linux (WSL) or other non-native Windows environments.
- Rust toolchain requirements when building from source.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 65 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 5,235,965/month — #2,132 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pywinpty-3.0.5-cp310-cp310-win_amd64.whl; pywinpty-3.0.5-cp310-cp310-win_arm64.whl; pywinpty-3.0.5-cp311-cp311-win_amd64.whl; pywinpty-3.0.5-cp311-cp311-win_arm64.whl; pywinpty-3.0.5-cp312-cp312-win_amd64.whl; pywinpty-3.0.5-cp312-cp312-win_arm64.whl; pywinpty-3.0.5-cp313-cp313t-win_amd64.whl; pywinpty-3.0.5-cp313-cp313t-win_arm64.whl; pywinpty-3.0.5-cp313-cp313-win_amd64.whl; pywinpty-3.0.5-cp313-cp313-win_arm64.whl; pywinpty-3.0.5-cp314-cp314t-win_amd64.whl; pywinpty-3.0.5-cp314-cp314t-win_arm64.whl; pywinpty-3.0.5-cp314-cp314-win_amd64.whl; pywinpty-3.0.5-cp314-cp314-win_arm64.whl
Keywords: PTY, Windows, pseudo-terminal, PyO3
Tags
More Terminals packages
Wraps any iterable to display a real-time…
copyleft · top 100 on PyPI
richRich renders styled text, tables, progress…
permissive · top 100 on PyPI
coloramaColorama makes ANSI escape sequences for…
permissive · top 100 on PyPI
wcwidthMeasures the displayed width of Unicode strings…
permissive · top 1,000 on PyPI
ptyprocessRun a subprocess in a pseudo terminal (pty) and…
permissive · top 1,000 on PyPI
pexpectPexpect spawns and controls interactive console…
permissive · top 1,000 on PyPI
dockerptyOperates the pseudo-terminal (PTY) allocated to…
permissive · top 15,000 on PyPI
pccmPCCM manages Python-to-C++ code generation and…
permissive · top 15,000 on PyPI
cmsis-pack-managerQueries and manages device information from…
permissive · top 5,000 on PyPI
maturinMaturin builds and publishes Python packages…
permissive · top 5,000 on PyPI
win_unicode_consoleFixes Unicode input and display in Python when…
permissive · top 15,000 on PyPI
ignore-pythonProvides fast recursive directory traversal…
unclear · top 15,000 on PyPI
wmctrlwmctrl provides programmatic control over…
permissive · top 15,000 on PyPI
pypsrpExecute commands, scripts, and file operations…
permissive · top 5,000 on PyPI