skillfed

pywinpty

Pseudo terminal support for Windows from Python.

pywinpty v3.0.5 5.2M downloads/30d#2,132 on PyPI165
Permissive license Active released

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 pywinpty

uv

uv add pywinpty

poetry

poetry add pywinpty

Installing 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

Development Status :: 5 - Production/StableLicense :: OSI Approved :: MIT LicenseOperating System :: Microsoft :: WindowsProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: Free ThreadingProgramming Language :: RustTopic :: TerminalsTopic :: Terminals :: Terminal Emulators/X Terminals

Tags

windows pseudoterminal pythonconpty wrapperwindows console process spawningpty emulation windowsterminal emulation windows pythonconsole input output pipeswindows pty python binding
windows-onlyterminal-emulationrust-binding

More Terminals packages