Skip to content

Instantly share code, notes, and snippets.

@y-rok
Last active August 19, 2020 05:34
Show Gist options
  • Save y-rok/403401a9933ff36c9357edf2697a6d2c to your computer and use it in GitHub Desktop.
Save y-rok/403401a9933ff36c9357edf2697a6d2c to your computer and use it in GitHub Desktop.
[python] main.py with command line argument
import argparse
import os
if __name__=="__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--ex', default="ex",
help="ex")
args = parser.parse_args()
# argument 정보를 적음
with open("arguments.txt","w") as f:
f.write(str(vars(args)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment