Closed mfitzp closed 7 years ago
As described by @CatherineH here https://github.com/wooey/Wooey/issues/44
Okay, I think I've figured it out -
issue 1, the argparser problem that I started with, is caused by having both the argparser and the parser.parse_args() defined in global scope. For example, this script works:
import argparse import sys parser = argparse.ArgumentParser(description='testing wooey.') parser.add_argument('--arg1', type=str, default="bloop", help='argument 1') parser.add_argument('--arg2', help='argument 1', type=str, default="bloop") parser.add_argument('--arg3', help='argument 1', type=str, default="bloop") def main(): args = parser.parse_args() print(vars(args)) if __name__ == "__main__": sys.exit(main())
So does this script:
import argparse if __name__ == "__main__": parser = argparse.ArgumentParser(description='testing wooey.') parser.add_argument('--arg1', type=str, default="bloop", help='argument 1') parser.add_argument('--arg2', help='argument 1', type=str, default="bloop") parser.add_argument('--arg3', help='argument 1', type=str, default="bloop") args = parser.parse_args() print(vars(args))
but this one does not:
import argparse parser = argparse.ArgumentParser(description='testing wooey.') parser.add_argument('--arg1', type=str, default="bloop", help='argument 1') parser.add_argument('--arg2', help='argument 1', type=str, default="bloop") parser.add_argument('--arg3', help='argument 1', type=str, default="bloop") args = parser.parse_args() print(vars(args))
which used to work in a previous version of Wooey.
This is no longer a bug. Probably fixed via #16
As described by @CatherineH here https://github.com/wooey/Wooey/issues/44
Okay, I think I've figured it out -
issue 1, the argparser problem that I started with, is caused by having both the argparser and the parser.parse_args() defined in global scope. For example, this script works:
So does this script:
but this one does not:
which used to work in a previous version of Wooey.