Pyreadline3 - Windows implementation of the GNU readline library

Overview

pyreadline3

Publish Test

The pyreadline3 package is based on the stale package pyreadline located here. The original pyreadline package is a python implementation of GNU readline functionality. It is based on the ctypes based UNC readline package by Gary Bishop. It is not complete. It has been tested for use with Windows 10.

Version 3.0+ of pyreadline3 runs on Python 3.8+.

Features

  • keyboard text selection and copy/paste
  • Shift-arrowkeys for text selection
  • Control-c can be used for copy activate with allow_ctrl_c(True) in config file
  • Double tapping ctrl-c will raise a KeyboardInterrupt, use ctrl_c_tap_time_interval(x)
  • where x is your preferred tap time window, default 0.3 s.
  • paste pastes first line of content on clipboard.
  • ipython_paste, pastes tab-separated data as list of lists or numpy array if all data is numeric
  • paste_mulitline_code pastes multi line code, removing any empty lines.

The latest development version is always available at the project git repository

Comments
  • TypeError: unsupported operand type(s) for +: 'Main' and 'str'

    TypeError: unsupported operand type(s) for +: 'Main' and 'str'

    I met this bug when I was running a class inherit the python Cmd class (I mean Main().cmdloop()) I think this module was imported by Cmd class for complete the command

    opened by MCTF-Alpha-27 0
  • Ctrl+C only quits a program after any other key is pressed

    Ctrl+C only quits a program after any other key is pressed

    Ctrl+C only quits a program after any other key is pressed.

    This always takes effect when readline is imported. Here is a little example program.

    import readline
    readline.parse_and_bind("tab: complete")
    
    def complete(text,state):
        volcab = ['dog','cat','rabbit','bird','slug','snail']
        results = [x for x in volcab if x.startswith(text)] + [None]
        return results[state]
    
    
    readline.set_completer(complete)
    
    try:
        line = input('prompt> ')
    except KeyboardInterrupt:
        from os import system
        system("color")
        print("\n\033[91mKeyboardInterrupt\033[0m")
    

    Press Ctrl+C, you will see that nothing happens until you press a regular key like H. This is on Bindows 10.

    opened by Dan-Gamin 0
  • Cleanup and refresh of the documents in the doc folder

    Cleanup and refresh of the documents in the doc folder

    It seem that almost all docs in the doc folder are either very outdated or wrong, with very poor formatting. A refresh and update would be helpful, especially in order to better explain various usage scenarios.

    Using standard mark down files (*.md) are also preferred to the *.rst files.

    opened by eabase 0
  • Improve and expand the README

    Improve and expand the README

    The original README.rst is over 9 years old! It is also completely incomprehensible and useless, not telling much what this package is doing, when to use it, or how to use it.

    I strongly suggest to clarify the utilization of this package, and how to use it from a practical point of view (I.e. key sequences that actually does something in REPL, for example.) and also from a more abstract and development point of view. (When and why does your package need to use readline?)

    • [ ] Also update the README to use the mark down extension: README.md.
    • [ ] Add some screenshots (of how it works and what it displays in various scenarios)
    • [ ] Answer some basic questions:
      • [ ] What does pyreadline do?
      • [ ] Why is pyreadline needed?
      • [ ] When do I need or want to use pyreadline?
      • [ ] How do I include pyreadline in my own package or dependencies?
      • [ ] When should I not use pyreadline?
      • [ ] What is the relationship between pyreadline and readline?

    Other questions?
    Please comment!

    opened by eabase 0
  • Legacy pyreadline issue and PR check list

    Legacy pyreadline issue and PR check list

    Here are all the currently open PR's and issues from pyreadline repo.

    Please use this list to check off the items that have been fixed here. If you do check it off, and if it's not too much to ask, please comment with the PR that fixed it.


    • [ ] [77] UnicodeDecodeError after using sympy's math expressions?
    • [ ] [76] Anyone interested in making an unofficial maintained branch of this?
    • [ ] [75] Fix for variable assignment issue in keysyms mod
    • [ ] [74] Code error in pyreadline/keysyms/init.py
    • [ ] [73] python.exe on Windows 10 with Python 3.10 errors after this module is installed
    • [ ] [72] Fix Python 3.10 AtributeError
    • [ ] [71] input color not working on windows(10)[19042]
    • [ ] [70] AttributeError: module 'readline' has no attribute 'redisplay'
    • [ ] [69] Remove deprecation warning
    • [ ] [68] Fix deprecation warning
    • [x] [67] BUG: fix regex to avoid DoS
    • [ ] [65] collections deprecation warning (potential incompatibility with Python 3.9)
    • [x] [64] Press at the beginning of the line
    • [ ] [62] [UnicodeDecodeError] - UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 321: illegal multibyte sequence
    • [x] [61] #54 UnicodeDecodeError
    • [ ] [60] Open history file with utf-8 encoding, fix #55 on Python 3 too
    • [ ] [59] module 'pyreadline' has no attribute 'parse_and_bind'
    • [ ] [58] Project status?
    • [ ] [57] Open history file with utf-8 encoding, fix #55
    • [ ] [56] Fix redisplay() missing & history-files with non-latin chars
    • [ ] [55] Reading history file fails with non-latin chars on Windows
    • [ ] [54] .python_history file decoding error when it has non-ascii char
    • [ ] [53] TypeError: unsupported operand type(s) for *: 'ReadLineTextBuffer' and 'int'
    • [ ] [52] AttributeError: module 'pyreadline.console' has no attribute 'Console'
    • [ ] [51] Implement readline.redisplay(), fixing #49
    • [ ] [50] Fix typo
    • [ ] [49] AttributeError: module 'readline' has no attribute 'redisplay'
    • [x] [48] Make it possible to use colored completions
    • [ ] [46] windows 10(ver 1607) cmd.exe ansi color text not work.
    • [ ] [45] No behavior for arbitrary input autocomplete set-up
    • [x] [44] switch to setup tools
    • [ ] [43] Parse and bind editing mode
    • [ ] [42] Uninstall readline hook on exception -- OUTDATED
    • [ ] [41] v2.1 changes missing from github
    • [ ] [40] pyreadline==2.1 install fails using pip
    • [ ] [39] Slow pasting of code into default Python interpreter
    • [ ] [38] Python 3.5 support
    • [ ] [37] Wrong cursor position when entering Unicode
    • [ ] [34] Non incremental search fails on python 3
    • [ ] [33] AttributeError: 'module' object has no attribute 'logger'
    • [ ] [31] Multi-line input is displayed incorrectly
    • [ ] [30] Incorrect encoding of history files
    • [ ] [29] vi-mode and swedish characters
    • [x] [28] Fixed typo and docstring line length
    • [ ] [27] ~~Fix Ctrl-R and Ctrl-S prompt that does not accept space character as par...~~ -- Still Relevant?
    • [ ] [26] ~~Change behavior of return key in the interactive search.~~ -- NOT Relevant
    • [ ] [24] :o: Isolate kernel32 DLL usage. -- Probably Good Idea!
    • [ ] [23] selection commands don't work with ipython/cygwin
    • [ ] [22] Current build confuses py2exe; conflict with console module
    • [ ] [20] ~~Update eggsetup.py~~ DEPRECATED
    • [ ] [19] ~~Update setup.py~~ DEPRECATED
    • [ ] [17] :o: Missing readline methods implemented
    • [ ] [16] correct name of python dll in case of debug python interpreter
    • [ ] [15] Modified rlmain.py to make saving the prompt position an option that is
    • [ ] [14] Cannot import pyreadline when username is not ascii
    • [ ] [12] Correction to README
    • [ ] [8] resurrect ironpython support
    • [ ] [5] ironpython support is broken
    opened by eabase 2
Releases(v3.4.1)
Multifunctional library for creating progress bars.

👋 Content Installation Using github Using pypi Quickstart Flags Useful links Documentation Pypi Changelog TODO Contributing FAQ Bar structure ⚙️ Inst

DenyS 27 Jan 01, 2023
cmsis-pack-manager is a python module, Rust crate and command line utility for managing current device information that is stored in many CMSIS PACKs

cmsis-pack-manager cmsis-pack-manager is a python module, Rust crate and command line utility for managing current device information that is stored i

pyocd 20 Dec 21, 2022
A 3D engine powered by ASCII art

3D engine powered by ASCII art

Lingdong Huang 48 Nov 16, 2022
A simple command line tool written in python to manage a to-do list

A simple command line tool written in python to manage a to-do list Dependencies: python Commands: todolist (-a | --add) [(-p | --priority)] [(-l | --

edwloef 0 Nov 02, 2021
Shazam is a Command Line Application that checks the integrity of the file by comparing it with a given hash.

SHAZAM - Check the file's integrity Shazam is a Command Line Application that checks the integrity of the file by comparing it with a given hash. Crea

AnaxĂ­meno Brito 1 Aug 21, 2022
Simple CLI prompt for easy I/O with OpenAI's API

openai-cli-prompt Simple CLI prompt for easy I/O with OpenAI's API Quickstart Create a .env file with: OPENAI_API_KEY=Your OpenAI API Key Configure

Erik Nomitch 1 Oct 12, 2021
Command line util for grep.app - Search across a half million git repos

grepgithub Command line util for grep.app - Search across a half million git repos Grepgithub uses grep.app API to search GitHub repositories, providi

Nenad Popovic 18 Dec 28, 2022
A CLI Application to detect plagiarism in Source Code Files.

Plag Description A CLI Application to detect plagiarism in Source Code Files. Features Compare source code files for plagiarism. Extract code features

default=dev 2 Nov 10, 2022
Easily handle day to day CLI operation via Python instead of regular Bash programs.

pz Ever wished to use Python in Bash? Would you choose the Python syntax over sed, awk, ...? Should you exactly know what command would you use in Pyt

CZ.NIC 697 Jan 03, 2023
Splitgraph command line client and python library

Splitgraph Overview Splitgraph is a tool for building, versioning and querying reproducible datasets. It's inspired by Docker and Git, so it feels fam

Splitgraph 313 Dec 24, 2022
Command-line interface to PyPI Stats API to get download stats for Python packages

pypistats Python 3.6+ interface to PyPI Stats API to get aggregate download statistics on Python packages on the Python Package Index without having t

Hugo van Kemenade 140 Jan 03, 2023
A CLI tool for using GLIDE to generate images from text.

Text-Glided-Diffusion Installation First clone this repository: git clone https://github.com/afiaka87/text-glided-diffusion.git cd text-glided-diffusi

Clay Mullis 68 Dec 30, 2022
Voidlx is a terminal cli apps launcher made in python

Voidlx is a terminal cli apps launcher made in python

2 Nov 13, 2021
Chameleon is yet another PowerShell obfuscation tool designed to bypass AMSI and commercial antivirus solutions.

Chameleon is yet another PowerShell obfuscation tool designed to bypass AMSI and commercial antivirus solutions. The tool has been developed as a Python port of the Chimera project, by tokioneon_.

332 Dec 26, 2022
Python Library and CLI for exporting MySQL databases

expdb Python library and CLI for exporting MySQL databases Installation Pre-requisites MySQL server Python 3.9+ Using git Clone the repository to your

Devansh Singh 1 Nov 29, 2021
A Python module and command line utility for working with web archive data using the WACZ format specification

py-wacz The py-wacz repository contains a Python module and command line utility for working with web archive data using the WACZ format specification

Webrecorder 14 Oct 24, 2022
spotifytools is a Python command line tool

spotifytools spotifytools is a Python command line tool Documentation The documentation is available on the following link Releases Instalation instru

0 Sep 28, 2021
Python codecs extension featuring CLI tools for encoding/decoding anything

CodExt Encode/decode anything. This library extends the native codecs library (namely for adding new custom encodings and character mappings) and prov

Alex 210 Dec 30, 2022
A simple CLI application helps you to find giant files that are eating up your system storage

Large file finder Sometimes it's very hard to find if some giant files are eating up your system storage. We might need to hunt those down. This simpl

Rahul Baruri 5 Nov 18, 2022
The most comprehensive, exhaustive, parameterized command-line wordle solver.

Wordle Solver The most comprehensive, exhaustive, parameterized command-line wordle solver. Wordle is a real

Debarghya Das 27 Nov 21, 2022