Skip to content

Instantly share code, notes, and snippets.

@Ry0
Created August 12, 2015 14:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ry0/d070787b38d66bf0e027 to your computer and use it in GitHub Desktop.
Save Ry0/d070787b38d66bf0e027 to your computer and use it in GitHub Desktop.
test gist
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