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)
Display Images in your terminal with python

A python library to display images in the terminal

Pranav Baburaj 57 Dec 30, 2022
A command-line utility that creates projects from cookiecutters (project templates), e.g. Python package projects, VueJS projects.

Cookiecutter A command-line utility that creates projects from cookiecutters (project templates), e.g. creating a Python package project from a Python

18.6k Dec 30, 2022
Salesforce object access auditor

Salesforce object access auditor Released as open source by NCC Group Plc - https://www.nccgroup.com/ Developed by Jerome Smith @exploresecurity (with

NCC Group Plc 90 Sep 19, 2022
Tool for HackMyVM platform

HMV-cli It is a tool for the HackMyVM platform. With this tool you will be able to see the machines you have pending, filter by difficulty, download d

bitc0de 11 Sep 19, 2022
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
GDBIGtools: A command line tools for GDBIG varaints browser

GDBIGtools: A command line tools for GDBIG varaints browser Introduction Born in Guangzhou Cohort Study Genome Research Database is based on thousands

广州市出生队列基因组学研究(The genomics study of BIGCS) 7 Sep 14, 2022
AthenaCLI is a CLI tool for AWS Athena service that can do auto-completion and syntax highlighting.

Introduction AthenaCLI is a command line interface (CLI) for the Athena service that can do auto-completion and syntax highlighting, and is a proud me

dbcli 192 Jan 07, 2023
Pynavt is a cli tool to create clean architecture app for you including Fastapi, bcrypt and jwt.

Pynavt _____ _ | __ \ | | | |__) | _ _ __ __ ___ _| |_ | ___/ | | | '_ \ / _` \ \ / /

Alejandro Castillo 1 Dec 13, 2021
Display Images in your terminal with python

Term-Img Display Images in your terminal with python NOTE: This project is a work in progress and not everything on here has actually been implemented

My avatar ;D 118 Jan 05, 2023
CLI/library to control FNIRSI DC Power Supply (DC-6006L, etc)

dc6006l - CLI/library to control FNIRSI DC Power Supply (DC-6006L, etc) What is this? FNIRSI DC6006L is a programmable DC power supply that is quite c

Taisuke Yamada 7 Sep 25, 2022
Command Line Based Todo Script

Todo-CLI Features Full-Fledged Command Line Based Todo List with the following features planned: Interactive Interface OS Notifications Save and Remov

DSC IIEST 5 Nov 17, 2021
Apple Silicon 'top' CLI

asitop pip install asitop What A nvtop/htop style/inspired command line tool for Apple Silicon (aka M1) Macs. Note that it requires sudo to run due to

Timothy Liu 1.2k Dec 31, 2022
An question and answer shell environment based on xonsh using ansible for setup

An question and answer shell environment based on xonsh using ansible for setup

Steven Hollingsworth 2 Jan 11, 2022
Hurry is a CLI tool to speed setting up MoniGoMani HyperStrategy & co. #freqtrade #hyperopting #trading #strategy

Hurry is a CLI tool to speed setting up MoniGoMani HyperStrategy & co. #freqtrade #hyperopting #trading #strategy

10 Dec 29, 2022
Container images for portable development environments

Docker Dev Spin up a container to develop from anywhere! To run, just: docker run -ti aghost7/nodejs-dev:boron tmux new Alternatively, if on Linux: p

Jonathan Boudreau 163 Dec 22, 2022
Synchronization tool for external devices which does not support time stamps, e.g. over MTP.

MTP-Sync Tool to synchronize data to a slow device, e.g. a smartphone which is connected over MTP. A state file (.mtp_sync_state.json) is created in t

2 Jul 22, 2022
Albert launcher extension for converting units of length, mass, speed, temperature, time, current, luminosity, printing measurements, molecular substance, and more

unit-converter-albert-ext Extension for converting units of length, mass, speed, temperature, time, current, luminosity, printing measurements, molecu

Jonah Lawrence 2 Jan 13, 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
Todo - You could use terminal to set your todo

Python Tutorial You can learn how to build a terminal application(CLI applicatio

29 Jun 29, 2022
Several tools that can be added to your `PATH` to make your life easier.

CK-CLI Tools Several tools that can be added to your PATH to make your life easier. prettypath Prints the $PATH variable in a human-readable way. It a

Christopher Kumm 2 Apr 21, 2022