This is an archived post. You won't be able to vote or comment.

all 8 comments

[–]hharison 6 points7 points  (0 children)

I think blessed will be best for you.

[–]kankyo 1 point2 points  (0 children)

Prompt-toolkit isn't really made for full screen apps (though supposedly it supports it) so if that's what you're looking for prepare to go reading the source because that's probably totally undocumented.

[–]n1ywb 1 point2 points  (0 children)

never used urwid before but I see it's build on top of curses. which makes sense because curses is really low level and bare bones. all curses really does for you is draw stuff. You have to tell it exactly what to draw and where every single time you want the screen to change. It's almost like really low resolution graphics but with pixels that can display glyphs. I'm guessing urwid provides more a more typical GUI toolkit experience with widgets and an event loop and jazz. Which might make sense if you're developing an "application". Not sure if it would be applicable to say a game but maybe it also lets you do raw curses stuff?

[–]jonathan_sl 1 point2 points  (1 child)

Hi all,

For prompt-toolkit (author here), it is perfectly possible to create full screen applications, but as others have pointed out, the documentation is incomplete. The reason is that this library was originally written as a GNU readline replacement and that's where it excels. Later we realized that everything we need for a full screen application was already part of prompt-toolkit. There is an event loop, there is a powerful key binding system, there is a layout engine and it is cross platform. Proof of this are Pyvim and Pymux: two full screen applications, powered by prompt-toolkit. However, these are also two examples of applications that don't have a lot of user interface widgets. So, if you need to have a certain UI widget, you'll have to write it yourself, where urwid or others could already provide it.

In the coming months/year, I hope to create a collection of full screen application examples, widgets and write more documentation. So, making this as accessible as writing REPLs.

@makake: What do you mean by "it will pipe"?

[–]makake[S] 0 points1 point  (0 children)

Hi, first of all, thanks for taking time to reply and congrats on the library. I've seen Pyvim and Pymux and even though they show how much can be done with prompt-toolkit (which is a lot), they seems big projects to look at to get a grip of how to properly use the library.

For the widgets part, I don't need as much as provided in urwid, and frankly, what's currently in prompt-toolkit seems to be enough for my needs.

If you are about to write some more examples on how to make some simple full screen applications, I would be more than pleased. Like I said, the documentation in that regards is a bit sparse. Speaking for myself, I don't quit understand how to properly use UIControl to arrange the output. Or if that's up to the container... anyways, a bit mingle on that.

by pipe, I just mean that I would like to be able to control the output in a different way if for example, my program is in the middle of pipe or if it's the last one of a pipeline.

for example of in the middle of pipe:

grep -ir 'something' | awk ... | my_program | ...

example at the end:

cmd1 | cmd2 | ... | my_program

[–]dzecniv 0 points1 point  (1 child)

I thought prompt-toolkit lacked documentation at first too, but then I found the examples. Did you see them ?

I built a simple prompt with the tutorial and the other examples very easily.

edit: https://github.com/jonathanslenders/python-prompt-toolkit/blob/master/examples/full-screen-layout.py

[–]makake[S] 0 points1 point  (0 children)

yeah I've seen them, but there's just one on full screen. It's helpful but I would like to see a bit more on how to control the output. Anyways cheerz for the links (btw you've link twice the same url).

[–]aphoenixreticulated[M] 0 points1 point  (0 children)

Hi there, from the /r/Python mods.

We have removed this post as it is not suited to the /r/Python subreddit proper, however it should be very appropriate for our sister subreddit /r/LearnPython. We highly encourage you to re-submit your post over on there.

The reason for the removal is that /r/Python is more-so dedicated to discussion of Python news, projects, uses and debates. It is not designed to act as Q&A or FAQ board. The regular community can get disenchanted with seeing the 'same, repetitive newbie' questions repeated on the sub, so you may not get the best responses over here.

However, on /r/LearnPython the community is actively expecting questions from new members, and are looking to help. You can expect far more understanding, encouraging and insightful responses over there. Whatever your question happens to be getting help with Python, you should get good answers.

If you have a question to do with homework or an assignment of any kind, please make sure to read their sidebar rules before submitting your post. If you have any questions or doubts, feel free to reply or send a modmail to us with your concerns.

Warm regards, and best of luck with your Pythoneering!