Created
August 12, 2015 14:54
-
-
Save Ry0/d070787b38d66bf0e027 to your computer and use it in GitHub Desktop.
test gist
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 input_arg(argvs, argc): | |
if (argc < 2 or 3 < argc): # 引数が足りない場合は、その旨を表示 | |
print 'Usage: # python %s Input_filename Output_filename' % argvs[0] | |
quit() # プログラムの終了 | |
elif (argc == 2): | |
d = datetime.now() | |
filename = "img-" + d.strftime('%Y') + "-" + d.strftime('%m') + "-" + d.strftime('%d') + "-" + d.strftime('%H') + "h" + d.strftime('%M') + "m" + d.strftime('%S') + "s.jpg" | |
argvs.append(filename) | |
print 'Input filename = %s' % argvs[1] | |
print 'Output filename = %s' % argvs[2] | |
# 引数でとったディレクトリの文字列をリターン | |
return argvs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment