我运行这个程序来拍摄我的屏幕快照并保存它但收到一条错误消息
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