Last active
August 19, 2020 05:34
-
-
Save y-rok/403401a9933ff36c9357edf2697a6d2c to your computer and use it in GitHub Desktop.
[python] main.py with command line argument
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 | |
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