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)
Fun project to generate The Matrix Code effect on you terminal.

Fun project to generate The Matrix Code effect on you terminal.

Henrique Bastos 11 Jul 13, 2022
Ideas on how to quickly learn to build command-line tools

CLI-Bootcamp Ideas on how to quickly learn to build command-line tools Part 1-Bash Week1: Using Linux Lesson 1: Using Linux Shell Lab Lesson 2: How sh

Noah Gift 10 Apr 18, 2022
dcargs is a tool for generating portable, reusable, and strongly typed CLI interfaces from dataclass definitions.

dcargs is a tool for generating portable, reusable, and strongly typed CLI interfaces from dataclass definitions.

Brent Yi 119 Jan 09, 2023
A curated list of awesome things related to Textual

Awesome Textual | A curated list of awesome things related to Textual. Textual is a TUI (Text User Interface) framework for Python inspired by modern

Marcelo Trylesinski 5 May 08, 2022
Redial is a simple shell application that manages your SSH sessions on Unix terminal.

redial redial is a simple shell application that manages your SSH sessions on Unix terminal. What's New 0.7 (19.12.2019) Basic support for adding ssh

Bahadır Yağan 186 Oct 28, 2022
Interactive Python interpreter for executing commands within Node.js

Python Interactive Interactive Python interpreter for executing commands within Node.js. This module provides a means of using the Python interactive

Louis Lefevre 2 Sep 21, 2022
Simple Digital Ocean CLI by python.

Simple Digital Ocean CLI by python.

Chiro 2 Jan 01, 2023
Command line tool for interacting and testing warehouse components

Warehouse debug CLI Example usage for Zumo debugging See all messages queued and handled. Enable by compiling the zumo-controller with -DDEBUG_MODE_EN

1 Jan 03, 2022
Run an FFmpeg command and see the percentage progress and ETA.

Run an FFmpeg command and see the percentage progress and ETA.

25 Dec 22, 2022
🪛 A simple pydantic to Form FastAPI model converter.

pyfa-converter Makes it pretty easy to create a model based on Field [pydantic] and use the model for www-form-data. How to install? pip install pyfa_

20 Dec 22, 2022
A helper program to play wordle

A helper program to play wordle

1 Jan 22, 2022
A simple cli tool to commit Conventional Commits

convmoji A simple cli tool to commit Conventional Commits. Requirements Install pip install convmoji convmoji --help Examples A conventianal commit co

3 Jul 04, 2022
Gamestonk Terminal is an awesome stock and crypto market terminal

Gamestonk Terminal is an awesome stock and crypto market terminal. A FOSS alternative to Bloomberg Terminal.

Gamestonk Terminal 18.6k Jan 03, 2023
Turdshovel is an interactive CLI tool that allows users to dump objects from .NET memory dumps

Turdshovel Description Turdshovel is an interactive CLI tool that allows users to dump objects from .NET memory dumps without having to fully understa

Leron Gray 41 Jul 27, 2022
Generate an ASCII Art from keyword put in the cli

ascii-art-generator-cli Generate an ASCII Art from keyword put in the cli Install git clone https://github.com/Nathanlauga/ascii-art-generator-cli cd

Nathan Lauga 1 Nov 14, 2021
Command line tool for google dorks

CLI for google dorks This is the command line tool made with pytohn which allows the users to perform Google dorks easily Installation Install google

subrahmanya s hegade 3 Feb 08, 2022
Easy-to-use terminal program that can compile your code.

Description Easy-to-use terminal program that can compile your code. Installition 1. Cloning repository $ git clone https://github.com/DarkJoij/Compil

DarkJoij 1 Oct 21, 2021
A simple and easy-to-use CLI parse tool.

A simple and easy-to-use CLI parse tool.

AbsentM 1 Mar 04, 2022
A Python3 rewrite of my original PwnedConsole project from almost a decade ago

PwnedConsoleX A CLI shell for performing queries against the HaveIBeenPwned? API to gather breach information for user-supplied email addresses. | wri

1 Jul 23, 2022
Lexeme - CLI to play a word-guessing game like Wordle

What is this? Python program to play a word-guessing game like Wordle, but… More addictive because you can play it over and over and over, not just on

Dan Lenski 6 Oct 26, 2022