Last active
June 5, 2016 08:06
-
-
Save ghost355/4d3b95ab50d5754e39143e4f9d111306 to your computer and use it in GitHub Desktop.
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
def arg_process(): | |
for arg in sys.argv[1:]: | |
if arg in ["-h", "--help"]: | |
print("usage:csv2html.py [maxwidth=int] [format=str] < infile.csv > outfile.html") | |
return None, None | |
elif arg.startswith(maxwidth_arg): | |
try: | |
maxwidth = int(arg[len(maxwidth_arg):]) | |
except ValueError: | |
pass | |
elif arg.startswith(format_arg): | |
format = arg[len(format_arg):] | |
return maxwidth, format | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment