
Show HN: Beautiful Python List Prompts Package - Mckinsey666
https://github.com/Mckinsey666/bullet
======
ethanpil
FYI, not exactly the same, but Dialog is an excellent tool for creating
ncurses based GUIs for shell scripts...

[http://www.unixcl.com/2009/12/linux-dialog-utility-short-
tut...](http://www.unixcl.com/2009/12/linux-dialog-utility-short-
tutorial.html)

~~~
Mckinsey666
Gee, this is legit. Gave me some insights. Thanks a lot :)!

~~~
1f97
if you want to use python together with dialog to build cli menus, i recommend
using
[http://pythondialog.sourceforge.net/doc/](http://pythondialog.sourceforge.net/doc/).
i've been using it for a project at work and it's very nice!

~~~
mlevental
seems like this isn't maintained?

------
lars512
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:

[https://github.com/larsyencken/questioner/](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.

~~~
Mckinsey666
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.

------
nmstoker
First thoughts were that this was handled by Prompt Toolkit, but it's actually
a slightly different case to the auto complete which that one offers:

[https://python-prompt-toolkit.readthedocs.io/en/stable](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.

------
Mckinsey666
Hey HN I've added some new features including a prompt wrapper object to wrap
the UI components together. Please check it out:

[https://github.com/Mckinsey666/bullet/blob/master/DOCUMENTAT...](https://github.com/Mckinsey666/bullet/blob/master/DOCUMENTATION.md)

~~~
Mckinsey666
btw thanks to lars512 for the advice.

------
Evidlo
Looks cool. I'd like to see more widgets though, like a checkbox or simple
form widget.

One package just for a radio list is too much like the npm way of doing
things.

~~~
Mckinsey666
Thanks for the feedback. I will add more features to this package asap.

------
rajasimon
I want this from Python Click. I remember I asked him on Twitter long back
don't know it's ported to Click.

[https://github.com/mitsuhiko/dialoguer](https://github.com/mitsuhiko/dialoguer)

[https://twitter.com/rajasimon/status/902894641770618880](https://twitter.com/rajasimon/status/902894641770618880)

~~~
BerislavLopac
Well there is Gooey, FWIW:
[https://pypi.org/project/Gooey/](https://pypi.org/project/Gooey/)

~~~
mlevental
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

~~~
sikhnerd
Possibly [https://github.com/szsdk/quick](https://github.com/szsdk/quick) ?

------
spark888
There is similar project
[https://github.com/Kamik423/cutie](https://github.com/Kamik423/cutie) for
someone who is interested in cli dialogs.

------
wonderfuly
I've previously built a similar package, much simpler:
[https://github.com/wong2/pick](https://github.com/wong2/pick)

------
mr_cyborg
I like this a lot. Will definitely try it out at some point.

------
slurryer
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?

~~~
rcfox
The readme only claims to support Linux.

termios is a built-in package, but not for Windows.
[https://docs.python.org/3/library/termios.html](https://docs.python.org/3/library/termios.html)

------
alex_g
This is awesome, I've been using Pick, but this looks a lot nicer!

------
black-tea
If there's one trend I can't stand it's developers claiming that their own
projects are "beautiful".

~~~
scbrg
Ah, natural languages and their lack of grouping operators.

It's _(Beautiful Python List Prompts) Package_ , not _Beautiful (Python List
Prompts Package)_.

~~~
black-tea
Oh, so the former is not _actually_ making any claims about being beautiful?
Please...

Just tell me what it does. I'll decide if it's beautiful.

------
whalesalad
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.

~~~
fermentation
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

~~~
Sean1708
Oh god the amount of scripts I have that do something like:

    
    
      while True:
        for i, item in enumerate(list):
          print(i, item, sep=" - ")
    
        choice = input()
    
        if valid(choice):
          break
    

This would make those _so_ much easier to write and give a much nicer UI at
the same time.

~~~
whalesalad
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.

