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)
Owner
null
a-shell: A terminal for iOS, with multiple windows

a-shell: A terminal for iOS, with multiple windows

Nicolas Holzschuch 1.7k Jan 2, 2023
Phishing-Detective is a command line application for Windows 10 built to detect a phishing site from two url's

Phishing-Detective Phishing-Detective is a command line application for Windows 10 built to detect a phishing site from two url's How it works A simpl

null 2 Jun 23, 2022
pyNPS - A cli Linux and Windows Nopaystation client made with python 3 and wget

Currently, all the work is being done inside the refactoring branch. pyNPS - A cli Linux and Windows Nopaystation client made with python 3 and wget P

Everton Correia 45 Dec 11, 2022
MsfMania is a command line tool developed in Python that is designed to bypass antivirus software on Windows and Linux/Mac in the future

MsfMania MsfMania is a command line tool developed in Python that is designed to bypass antivirus software on Windows and Linux/Mac in the future. Sum

null 446 Dec 21, 2022
Themes for Windows Terminal

Windows Terminal Themes Preview and copy themes for the new Windows Terminal. Use the project at windowsterminalthemes.dev How to use the themes This

Tom 1.1k Jan 3, 2023
Linux commands Interpreter for Windows and Mac based systems using Python

DBHTermEcIbP Linux commands Interpreter for Windows and Mac based systems using Python Basic Linux commands supported viewing current working director

Vraj Patel 1 Dec 26, 2021
A Python-based command prompt concept which includes windows command emulation.

PythonCMD A Python-based command prompt concept which includes windows command emulation. Current features: echo: Input your message and it will be cl

null 1 Feb 5, 2022
Library and command-line utility for rendering projects templates.

A library for rendering project templates. Works with local paths and git URLs. Your project can include any file and Copier can dynamically replace v

null 808 Jan 4, 2023
Rich is a Python library for rich text and beautiful formatting in the terminal.

The Rich API makes it easy to add color and style to terminal output. Rich can also render pretty tables, progress bars, markdown, syntax highlighted source code, tracebacks, and more โ€” out of the box.

Will McGugan 41.4k Jan 3, 2023
Write Django management command using the click CLI library

Django Click Project information: Automated code metrics: django-click is a library to easily write Django management commands using the click command

Jonathan Stoppani 215 Dec 19, 2022
๐Ÿ–๏ธThis is a feature-complete clone of the awesome Chalk (JavaScript) library.

Terminal string styling done right This is a feature-complete clone of the awesome Chalk (JavaScript) library. All credits go to Sindre Sorhus. Highli

Fabian Keller 132 Dec 27, 2022
A command line tool (and Python library) for archiving Twitter JSON

A command line tool (and Python library) for archiving Twitter JSON

Documenting the Now 1.3k Dec 28, 2022
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 1, 2023
A powerful Minecraft command library.

Mecha A powerful Minecraft command library. from mecha import Mecha

null 32 Dec 10, 2022
NudeNet wrapper made to provide a simple cli interface to the library

Nudenet Wrapper. Small warpper script for NudeNet Made to provide a small and easy to use cli interface with the library. You can indicate a single im

null 1 Oct 20, 2021
Enlighten Progress Bar is a console progress bar library for Python.

Overview Enlighten Progress Bar is a console progress bar library for Python. The main advantage of Enlighten is it allows writing to stdout and stder

Rockhopper Technologies 265 Dec 28, 2022
Investing library and command-line interface inspired by the Bogleheads philosophy

Lakshmi (Screenshot of the lak command in action) Background This project is inspired by Bogleheads forum. Bogleheads focus on a simple but powerful p

Sarvjeet Singh 108 Dec 26, 2022
โš™ A lightweight command line interface library for creating commands.

โš™ A lightweight command line interface library for creating cli commands. About | Installation | Usage | Features | Contributors | License About Next:

Serum 16 Sep 25, 2022