Hacker News new | ask | show | jobs
by whalesalad 2672 days ago
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.

3 comments

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 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
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.
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.
It’s just a command line library for spliffying up command line interfaces.

Where does React come into this? That’s for the web...