prompt-toolkit / python-prompt-toolkit

Library for building powerful interactive command line applications in Python
https://python-prompt-toolkit.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
9.28k stars 715 forks source link

suggestion about alternative input/output layout #234

Open fbenmena opened 8 years ago

fbenmena commented 8 years ago

In most examples, the REPL loop works in a single window. Each input is immediately followed by the output of the concerned result. The prompt_toolkit may provide a way in which the input and the output appear in different buffers. A typical approach may follow the layout provided in the 'full-screen-layout' example. For instance on the left pane, one may have the input while the buffer on the right one is updated with the output of the last result. This may help for the design of board games.

I'm wondering whether it is possible to have a simple prompt loop on one window and the output occurring in an other.

Thanks.

jonathanslenders commented 8 years ago

Hi @fbenmena,

This is possible, but not very easy. It requires a custom layout, and the event loop needs to run during the lifetime of the whole application. (To make sure everything stays responsive.) Other people have asked for something similar, so now I consider making a simple example.

However, I have a few other priorities first, but I'll keep this in mind. (In the future, it should definitely become more obvious how to create more complex applications. The library supports it, but not all the APIs for this are completely stable, and some things still have to be documented.)

Jonathan

fbenmena commented 8 years ago

Hi Jonathan,

Keep in mind that I consider your work as a awesome piece of software. I'm confident about some missing features or some code refactoring coming on their time. It's very pleasant for me, as a novice developer, to follow the line spotted with your commits.

Keep the good work and take care, Farès

----- Mail original ----- De: "Jonathan Slenders" notifications@github.com À: "jonathanslenders/python-prompt-toolkit" python-prompt-toolkit@noreply.github.com Cc: "fbenmena" fares.benmena@free.fr Envoyé: Lundi 8 Février 2016 22:22:52 Objet: Re: [python-prompt-toolkit] suggestion about alternative input/output layout (#234)

Hi @fbenmena ,

This is possible, but not very easy. It requires a custom layout, and the event loop needs to run during the lifetime of the whole application. (To make sure everything stays responsive.) Other people have asked for something similar, so now I consider making a simple example.

However, I have a few other priorities first, but I'll keep this in mind. (In the future, it should definitely become more obvious how to create more complex applications. The library supports it, but not all the APIs for this are completely stable, and some things still have to be documented.)

Jonathan

— Reply to this email directly or view it on GitHub .