Last active
August 12, 2019 17:30
-
-
Save shubhamagarwal92/450df34aa497ab2c70f68492a50c16f3 to your computer and use it in GitHub Desktop.
convert args from argparse to dictionary
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
def parse_args(): | |
.... | |
return args | |
args = parse_args() | |
config = vars(args) | |
for arg in vars(config): | |
print("{:<20}: {}".format(arg, getattr(config, arg))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment