Closed milahu closed 2 years ago
Thanks for this - there's no way of perfectly emulating argparse behaviour here but I've tweaked the function to avoid throwing an error here
Fixed in 2022.1 let me know if that has solved things for you
argparse behaviour
aah, because when i say type=argparse.FileType("r")
then argparse will open the file, and return the file handle as value
should be fixed ... thanks : )
why do we call
open
here?the
run
function just needs the file path path should be validated withos.path.exists(path)
https://github.com/FHPythonUtils/Cli2Gui/blob/6b378034a5ade5dc06109c98814d18f6e6c2717e/cli2gui/application/pysimplegui2args.py#L11-L18
in my case
values[key] == ""
soopen
throwsFileNotFoundError(2, 'No such file or directory')
my parser looks like