You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the user provides command line arguments when starting the program, then I would like to use these values to override the defaults shown in the GUI. Is this possible? Currently it seems that Cli2Gui ignores these command line arguments when using the decorator approach such as the example below.
If the code below was called as python myapp -name me -age 18 then I would expect the GUI to showme in the name textbox and 18 in the age textbox as the default response. Instead we see a blank name and age 21...
Basically I am seeking the functionality offered by Gooey through the use_cmd_args parameter. See description here.
Thank you.
importargparsefromcli2guiimportCli2Gui# Define the function that will handle the program's logicdefrun(args):
print(args.arg)
# Use Cli2Gui as a decorator to convert CLI into a GUI, using deargui@Cli2Gui(run_function=run, gui="deargui", auto_enable=True)defmain():
parser=argparse.ArgumentParser(description="Example parser with GUI support")
parser.add_argument("--name", help="Enter your name", required=True)
parser.add_argument("--age", type=int, default=21, help="Enter your age")
args=parser.parse_args()
run(args)
if__name__=="__main__":
main()
The text was updated successfully, but these errors were encountered:
If the user provides command line arguments when starting the program, then I would like to use these values to override the defaults shown in the GUI. Is this possible? Currently it seems that
Cli2Gui
ignores these command line arguments when using the decorator approach such as the example below.If the code below was called as
python myapp -name me -age 18
then I would expect the GUI to showme
in thename
textbox and18
in theage
textbox as the default response. Instead we see a blank name and age21
...Basically I am seeking the functionality offered by
Gooey
through theuse_cmd_args
parameter. See description here.Thank you.
The text was updated successfully, but these errors were encountered: