When I try to get argument with flag "--from" from argparse.ArgumentParser.parse_args() an error occurs. IDE says that "from" is import statement and the code is unreachable:
parser = argparse.ArgumentParser(prog='cache_wiki.py',
description='Find shortest path between links')
parser.add_argument('--from', required=True, help='page to start search with')
args = parser.parse_args()
print(args.from)
It is ok with another name:
parser = argparse.ArgumentParser(prog='cache_wiki.py',
description='Find shortest path between links')
parser.add_argument('--f', required=True, help='page to start search with')
args = parser.parse_args()
print(args.f)
but I really need to use flag "--from".
args.fromis a syntax error.