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)
A Yahtzee-solving python package and command line tool.

yahtzee A Yahtzee-solving python package and command line tool. The algorithm is mathematically guaranteed to have the best strategy. That is, it maxi

David Merrell 0 Aug 19, 2022
A python based command line tool to compare Github Users or Repositories

gitcomp A simple python package with a CLI to compare GitHub users and repositories by associating a git_score to each entry which is a weighted sum o

Anirudh Vaish 5 Mar 26, 2022
A simple CLI based any Download Tool, that find files and let you stream or download thorugh WebTorrent CLI or Aria or any command tool

Privateer A simple CLI based any Download Tool, that find files and let you stream or download thorugh WebTorrent CLI or Aria or any command tool How

Shreyash Chavan 2 Apr 04, 2022
spid-sp-test is a SAML2 SPID/CIE Service Provider validation tool that can be executed from the command line.

spid-sp-test spid-sp-test is a SAML2 SPID/CIE Service Provider validation tool that can be executed from the command line. This tool was born by separ

Developers Italia 30 Nov 08, 2022
Logic-Sim - A clone of 'Digital Logic Sim' from Sebastian Lague

Logic Simulator This is a clone of 'Digital Logic Sim' from Sebastian Lague. But

Ethan 1 Feb 01, 2022
A next-generation CLI and TUI that aims to be your personal assistant for everything competitive programming related. 🚀

Competitive Programming Tool Kit The Competitive Programming Tool Kit (cptk for short), is a command line and terminal user interface (CLI and TUI) th

Alon 4 May 21, 2022
A Hikari command handler for people who love ducks.

duckari A Hikari command handler made with love by ducks. Currently Duckari is work in progress. Documentation is WIP. The wiki is no longer used as d

2 Oct 09, 2022
Simple command-line implementation of minesweeper

minesweeper This is a Python implementation of 2-D Minesweeper! Check out the tutorial here: https://youtu.be/Fjw7Lc9zlyU You start a game by running

Kylie 49 Dec 10, 2022
Example of a CLI with python - know the extension of your files.

extensionCLI Example of a CLI with python - know the extension of your files. Usage: Install the CLI: pip3 install -e . Run the command with "ext" + t

ItanuRomero 5 Dec 29, 2022
kitty - the fast, feature-rich, cross-platform, GPU based terminal

kitty - the fast, feature-rich, cross-platform, GPU based terminal

Kovid Goyal 17.3k Jan 04, 2023
ddgr is a cmdline utility to search DuckDuckGo (html version) from the terminal

ddgr is a cmdline utility to search DuckDuckGo (html version) from the terminal. While googler is extremely popular among cmdline users, in many forums the need of a similar utility for privacy-aware

Piña Colada 2.5k Dec 25, 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
A command line tool to hide and reveal information inside images (works for both PNGs and JPGs)

ImgReRite A command line tool to hide and reveal information inside images (work

Jigyasu 10 Jul 27, 2022
Commandline Python app to Autodownload mediafire folders and files.

Commandline Python app to Autodownload mediafire folders and files.

Tharuk Renuja 3 May 12, 2022
Bear-Shell is a shell based in the terminal or command prompt.

Bear-Shell is a shell based in the terminal or command prompt. You can navigate files, run python files, create files via the BearUtils text editor, and a lot more coming up!

MichaelBear 6 Dec 25, 2021
A cd command that learns - easily navigate directories from the command line

NAME autojump - a faster way to navigate your filesystem DESCRIPTION autojump is a faster way to navigate your filesystem. It works by maintaining a d

William Ting 14.5k Jan 03, 2023
🎄 Advent of Code command-line tool.

🎄 advent-cli advent-cli is a command-line tool for interacting with Advent of Code, specifically geared toward writing solutions in Python. It can be

Christian Ferguson 6 Dec 01, 2022
A simple CLI tool for tracking Pikud Ha'oref alarms.

Pikud Ha'oref Alarm Tracking A simple CLI tool for tracking Pikud Ha'oref alarms. Polls the unofficial API endpoint every second for incoming alarms.

Yuval Adam 24 Oct 10, 2022
A simple command line chat app to communicate via the terminal.

A simple command line chat app to communicate via the terminal. I'm new to networking so sorry if some of my terminology or code is messed up.

PotNoodle 1 Oct 26, 2021
WebApp Maker make web apps (Duh). It is open source and make with python and shell.

WebApp Maker make web apps (Duh). It is open source and make with python and shell. This app can take any website and turn it into an app. I highly recommend turning these few websites into webapps:

2 Jan 09, 2022