News for hackers. Stuff that matters.
Re:Gooey: Turn almost any Python command line program into a... by frederikvs on Monday June 14, 2021 @01:55PM (#27505815)
In our setup, we have a class that does the heavy lifting. The file where that class lives ends with :

    if __name__ == '__main__':
        fire.Fire(JobManager)
which turns it into an instant CLI.

Then we have a separate gui.py file, which contains the Gooey code. This includes the class mentioned above, and builds a minimalistic GUI around it. This does need some argparse-based code, but in the GUI we only expose a small subset of the full power, so we only need a little bit of argparse-code.

P.S. I'm not certain this is the best way to approach things, but it's the way we use it, and we're happy with it so far.

There are no comments on this comment yet.