Questions tagged [prompt-toolkit]

prompt_toolkit is a library for building powerful interactive command lines and terminal applications in Python.

prompt_toolkit is a library for building powerful interactive command lines and terminal applications in Python.

You will find the source code and relevant links to documentation, tutorial, examples here: https://github.com/jonathanslenders/python-prompt-toolkit

58 questions
6
votes
0 answers

Customizing keyboard shortcuts in IPython 5

In IPython 5.0, with the new prompt_toolkit backend, how can modify or add new keyboard shortcuts? For example, I want to make it so that up arrow goes back in history, rather than doing a history search (which is the default behavior).
asmeurer
  • 86,894
  • 26
  • 169
  • 240
6
votes
2 answers

How does one set specific vim-bindings in Ipython 5.0.0

I understand that because Ipython 5.0.0 uses a new input library (prompt_toolkit) it no longer defaults to the editor mode specified in .inputrc (*nix). This option has to be set in an Ipython profile configuration file (see…
jeicher
  • 73
  • 5
4
votes
0 answers

Prompt_toolkit custom event, like input from non user function

I'm trying to find some documentation about how to add a custom handler, hook etc. to automatically add text, or generally modify the full screen app. I'd want to render a dict received via a named pipe (from another terminal app running in another…
geekscrap
  • 965
  • 2
  • 12
  • 26
4
votes
1 answer

How to reuse completions from PathCompleter in prompt_toolkit

I am creating a REPL tool for my project that (simplified for clarity) either directly executes entered commands or (if a command ".x some/path/to/file" is entered) reads and executes them from file. My question is related to auto-completing the…
honza_p
  • 2,073
  • 1
  • 23
  • 37
3
votes
0 answers

How do I debug using IDE debugger with the Python Prompt Toolkit

I have been using the Python Prompt Toolkit https://github.com/prompt-toolkit/python-prompt-toolkit, but Im having a hard time using it with my IDE. I have to force my IDE to emulate the console as a terminal and it really limits everything I can do…
Spectrem
  • 682
  • 1
  • 11
  • 37
3
votes
1 answer

prompt-toolkit: Dynamically add and remove buffers to VSplit or HSplit?

is it possible to add and remove buffers? So I want to change a fullscreen layout. For example I want have some layout like this: layout = VSplit([ Window(content=BufferControl(buffer_name=DEFAULT_BUFFER)), Window(width=D.exact(1), …
Nick
  • 41
  • 3
3
votes
2 answers

tab complete key for __getitem__ in Python class

I'm implementing a python class that contains a 2d numpy array (self.data) that I have set up for column access with a string key. The keys are contained in a dict that maps names to column indices (e.g., self.coldict={'col0':0,...,'colN':N}), and…
2
votes
0 answers

Add a popup dailog in fullscreen app in python prompt_toolkit

I am creating a terminal chat application, where I have a UI with prompt_toolkit. There In message box i added some commands to perform some action. To create the Dashboard I used prompt_toolkit.Application And apply my functionalaty on top of…
2
votes
0 answers

Python Prompt-Toolkit Multiple Completions

I am curious if there is a way to do multiple completions without having a ton of nested dicts. If I look at the example they have completer = NestedCompleter.from_nested_dict( { "show": { "-i": { "a": None, …
yankeefan11
  • 485
  • 1
  • 6
  • 18
2
votes
0 answers

Running ipython from command line - ModuleNotFoundError: No module named 'prompt_toolkit.formatted_text'

I am trying to run iPython from the command line and get the error: ModuleNotFoundError: No module named 'prompt_toolkit.formatted_text' Because of that I read some posts where it was advised to install specific versions of prompt-toolkit and…
Tobitor
  • 1,388
  • 1
  • 23
  • 58
2
votes
2 answers

ipython: change PageDown/PageUp to move back/forward through command history

In my shell (zsh) or in python, I can go backward through command history by pressing PageDown, and I can go forward by pressing PageUp. But in ipython, these shortcuts are reversed. Where are these shortcuts defined for ipython, and how can I…
400 the Cat
  • 266
  • 3
  • 23
2
votes
1 answer

Python Prompt Toolkit: How to always open/show autocompleter?

I use prompt_toolkit to ask the user for some input: from prompt_toolkit import prompt from prompt_toolkit.completion import WordCompleter prompt('Input: ', completer=WordCompleter(['abc', 'def', 'xyz'])) Is it possible to show the suggestions…
Jonas
  • 357
  • 2
  • 8
2
votes
0 answers

display output streams with python's prompt_toolkit

I'm trying to capture output a output stream i.e. dmesg -w with the prompt_toolkit library[0], but I'm unable to find a good entrypoint. Creating an Application() allows you to pass a Layout() which takes Widgets such as Window which in turn take…
jaiks
  • 486
  • 4
  • 9
2
votes
1 answer

output text while using prompt_toolkit prompt function

I have a small interactive commandline application where i use the prompt function from prompt_toolkit to read user commands. Some commands will open threaded listeners to ports and will print to screen whenever something comes in on the port it is…
Johan
  • 1,633
  • 15
  • 22
2
votes
0 answers

Can't pip install anything EnvironmentError: [Errno 2]

Windows 10 I'm trying to pip install stuff, however since today I can't install anything because I keep getting the following error: Cold not install packages due to an EnvironmentError: [Errno 2] No such file or directory:…
Pickels
  • 23
  • 6
1
2 3 4