如何将可选标志传递给其他Python脚本? 我在下面写了这段代码:
argument_parser = argparse.ArgumentParser()
argument_parser.add_argument('-validation', help="it is for validation", action="store_true")
arguments = argument_parser.parse_args()
release_exe_path = os.path.join(dir_path, '__release__.py')
proc = subprocess.Popen(args=[python_exe_path, release_exe_path, '--mode', arguments.mode, '-project', arguments.project, '-site', arguments.site,'-validation'])
proc.wait()
但这会产生错误:
TypeError: argument of type 'NoneType' is not iterable
实际代码应该是什么?