Using sys.argv in examples

Note that your example will be run by sphinx-gallery without arguments.


sys.argv: ['/home/docs/checkouts/']
parsed args: Namespace(option='default')

import argparse
import sys

parser = argparse.ArgumentParser(description='Toy parser')
parser.add_argument('--option', default='default',
                    help='a dummy optional argument')
print('sys.argv:', sys.argv)
print('parsed args:', parser.parse_args())

Total running time of the script: ( 0 minutes 0.021 seconds)

Gallery generated by Sphinx-Gallery