ctypes-based Python wrapper for GNU Readline
Project description
pygnurl is a ctypes-based Python wrapper for GNU Readline intended to be used as a drop-in replacement for Python’s built-in readline module. It is currently intended for Windows (as Python on Windows comes without a readline module by default) and Mac OS X (as its readline module is implemented using libedit, not GNU Readline).
pygnurl works with 32- and 64-bit Python 2 and 3.
Requirements
pygnurl dynamically loads a Readline library, so you need a version matching the architecture of your Python interpreter (not necessarily your system).
More information on where to get Readline can be found on the Readline home page:
http://tiswww.case.edu/php/chet/readline/rltop.html#Availability
Windows users can get a pre-built 32-bit Readline DLL from:
Quick Start Guide
Set the PYGNURL_LIB environment variable to the filename of your Readline library. This will be loaded using the shared library search order rules of your system.
pip install pygnurl python >>> import rlcompleter >>> import readline >>> readline.parse_and_bind('tab: complete') >>> r<tab><tab>
If you set the PYTHONSTARTUP environment variable to a Python file, it will be run every time you start the interpreter. An example startup file giving tab completion and saved history is provided in pygnurl/scripts/startup.py. You can point the environment variable directly at this file, or you can copy it elsewhere and modify it to suit your needs.
Motivation
pygnurl aims to provide full GNU Readline support across all platforms with no compilation overhead. Any pre-built Readline library should be able to be dropped in with no code modifications. If necessary, version- or platform-specific compatibility fixes can be implemented in Python, not C.
Development
For source code, questions and bug reports, visit the GitHub repository:
Alternatives
readline - Part of the standard library. Python on Mac OS X may implement this using libedit instead of GNU Readline and must be configured accordingly.
pyreadline - A python implmentation of GNU readline.
gnureadline - The standard Python readline extension statically linked against the GNU readline library.
rl - Alternative Python bindings for GNU Readline.
Platforms |
Library |
Interfaces |
|
---|---|---|---|
Any |
Dynamic |
Subset |
|
Unix-like |
Static |
Subset |
|
Windows |
Pure Python |
Subset |
|
Unix-like |
Static |
Subset |
|
Unix-like |
Static |
All |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pygnurl-0.5.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f02864ad4ce69edf13e48d21c383965e6a003a5c0ec2096e0db1e9a73c8dbf8 |
|
MD5 | 44567360bd7dd1be61f67a603a0a7877 |
|
BLAKE2b-256 | 8c6b970cc42a92c70a2d5c21f29caedc598d7388490e664aa84fe939afa81681 |