Re:Gooey: Turn almost any Python command line program into a...
by jmholla on Monday June 14, 2021 @03:43PM
(#27507304)
Seems like you have update your API in two locations when changes happen, once in the `JobManager` definition and another time in the parser. How do you avoid issues with inconsistency?
So we have one file which contains the class with all the functions we want to expose (in our case, the class is named JobManager). At the end, it goes
which takes care of all the CLI access we could want.Then we have a second file for the GUI, which has a main-function that does some argparse stuff. The GUI interface is simplified from the CLI interface, so it's not that much work to write the argparse code for that. Simplified, it looks a little like this :