このプログラムを実行して画面のスナップショットを取得して保存しましたが、エラーメッセージが表示されます
import os
import sys
import time
import Image
import ImageGrab
SaveDirectory=r'C:\Documents and Settings\User\My Documents\My Pictures'
ImageEditorPath=r'C:\WINDOWS\system32\mspaint.exe'
img=ImageGrab.grab()
saveas=os.path.join(SaveDirectory,'ScreenShot_'+time.strftime('%Y_%m_%d%_%H_%M_%S')+'.png')
img.save(saveas)
editorstring='""%s" "%s"'% (ImageEditorPath,saveas)
os.system(editorstring)
これはエラーメッセージです:
Traceback (most recent call last):
File "C:/Python27/butt", line 10, in <module>
saveas=os.path.join(SaveDirectory,'ScreenShot_'+time.strftime('%Y_%m_%d%_%H_%M_%S')+'.png')
ValueError: Invalid format string