There is such code:
import argparse parser = argparse.ArgumentParser(description='test') parser.add_argument('-p',help='Path to file') args = parser.parse_args() fp = args.p print fp If you transfer there -p C: \ Program Files (x86) \. Will write an unrecognized argument. How to fix it?
sys.argvto be sure. The question is relevant as the arguments from cmd are passed to python. For example, in cmd.exe you will have to escape special characters such as^or spaces (^used in cmd to escape other characters, spaces to separate arguments from each other) - jfs