What are the use cases? This looks like a fun project without any real applications. A react component makes sense because it hooks into an existing ecosystem but how would something like this get used in an existing cli?
Edit: React has an ecosystem for things like this. Cocoa/Obj-C has an ecosystem for things like this. Tiny single purpose UI elements. Python does not have this because there is no UI framework for doing console applications that doesn’t already provide this capability as part of a batteries included tool.
I can think of a lot of simple scripts that I could easily plug this into. When I’m writing a little script to do something for me, the last thing I want to do is write any sort of UI
Can’t tell if you’re being sarcastic or not. Your above sample code is perfectly simple and straightforward. I would choose it over an over engineered ui library/dependency in a heartbeat.
I don't quite follow you here. It is a library for making some simple UI for command line applications.
If you have a command line application in python you could implement this for fancier list selections.
I'm unclear on how you relate this to React components. Python libraries have been part of an existing ecosystem long before React. The python ecosystem.
i'd say "beautiful" in this context is shorthand for "built with attention towards aesthetics", which is often not the case for programmer tools like this
This is really nice. I'm working on a similar project right now, trying to hook together a few console UI pieces like this into a coherent annotation tool:
Thanks for the feedback! Will definitely add more features to this package. Wrapping up several prompts together is a great idea too, thanks for the insight.
if you want to use python together with dialog to build cli menus, i recommend using http://pythondialog.sourceforge.net/doc/. i've been using it for a project at work and it's very nice!
do you know of an other package that does this? just yesterday and this morning I was looking for something like this but I could've sworn there's a more modern package. I just can't seem to find the right Google keywords to land on it.
edit: and in particular for click. i didn't realize gooey was for arg parse
Might be useful to handle deactivated choices (ie greyed out).
It looks like it handles multi choice (with the check feature), but can it do validation upon a check being selected or does it need to wait until the user has made their choice? Am thinking for catching invalid combinations.
termios issue. I installed this via pip in python 3.7 under windows 10 and got an error about the termios package not being available. But trying to install termios via pip reports that the package is not available.
Any suggestions?
32 comments
[ 2.9 ms ] story [ 75.6 ms ] threadEdit: React has an ecosystem for things like this. Cocoa/Obj-C has an ecosystem for things like this. Tiny single purpose UI elements. Python does not have this because there is no UI framework for doing console applications that doesn’t already provide this capability as part of a batteries included tool.
If you have a command line application in python you could implement this for fancier list selections.
I'm unclear on how you relate this to React components. Python libraries have been part of an existing ecosystem long before React. The python ecosystem.
Where does React come into this? That’s for the web...
One package just for a radio list is too much like the npm way of doing things.
It's (Beautiful Python List Prompts) Package, not Beautiful (Python List Prompts Package).
Just tell me what it does. I'll decide if it's beautiful.
https://github.com/larsyencken/questioner/
It's not as pretty as bullet, but it's trying to fit in an annotation loop. It would be super cool to extend bullet to choose-many questions too.
http://www.unixcl.com/2009/12/linux-dialog-utility-short-tut...
https://github.com/mitsuhiko/dialoguer
https://twitter.com/rajasimon/status/902894641770618880
edit: and in particular for click. i didn't realize gooey was for arg parse
https://python-prompt-toolkit.readthedocs.io/en/stable
Might be useful to handle deactivated choices (ie greyed out).
It looks like it handles multi choice (with the check feature), but can it do validation upon a check being selected or does it need to wait until the user has made their choice? Am thinking for catching invalid combinations.
https://github.com/Mckinsey666/bullet/blob/master/DOCUMENTAT...
termios is a built-in package, but not for Windows. https://docs.python.org/3/library/termios.html