You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @jonathanslenders I'm hoping you can give me some advice here. We are trying to build a prompt_toolkit app for interacting with devices over pyserial. We'd like it to be a full screen app and have at least two panes: one for displaying log messages from pyserial connected devices and one for an interactive python repl.
The PythonPane() class is a bunch of stuff copy pasted (for experimentation) from ptpython/repl.py and ptpython/python_input.py but without the bits to create a new a new prompt_toolkit application (from here). I also moved a bunch of logic from run() and eval()here in repl.py and moved it into the _accept_handlerhere
The goal being to allow embeding into an existing app. Some questions:
Is this a good way to do this? If yes would you accept a pull request to support this use case? I think it would have to refactor the parts that create a new app and layout outside of the PythonInput class and provide an example of how to override the accept_handler.
Currently it just logs the results instead of printing them. I still need to figure out how to make this bit not print to stdout and just return the formatted text instead.
Hi @jonathanslenders I'm hoping you can give me some advice here. We are trying to build a prompt_toolkit app for interacting with devices over pyserial. We'd like it to be a full screen app and have at least two panes: one for displaying log messages from pyserial connected devices and one for an interactive python repl.
Here's the layout:
To kick off the pt app I have:
The
PythonPane()
class is a bunch of stuff copy pasted (for experimentation) from ptpython/repl.py and ptpython/python_input.py but without the bits to create a new a newprompt_toolkit
application (from here). I also moved a bunch of logic fromrun()
andeval()
here in repl.py and moved it into the_accept_handler
hereThe goal being to allow embeding into an existing app. Some questions:
PythonInput
class and provide an example of how to override theaccept_handler
.prompt_toolkit
containers in it's UI that are updated asynchronously?Thanks for any feedback you can provide!
The text was updated successfully, but these errors were encountered: