← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #288410]: How can I save screenshot as "system date.png"

 

Question #288410 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/288410

    Status: Open => Answered

RaiMan proposed the following answer:
- with a human readable stamp (time is already imported by SikuliX)
import shutil
screenshotsDir = "C:/Users/sucheta/Desktop/screenshots"
filename = "%s.png" % (time.strftime("%Y-%m-%d_%H-%M-%S"))
img = capture(SCREEN)
shutil.move(img, os.path.join(screenshotsDir, filename))

- just using the internal seconds counter:
import shutil
screenshotsDir = "C:/Users/sucheta/Desktop/screenshots"
filename = "%d.png" % (time.time())
img = capture(SCREEN)
shutil.move(img, os.path.join(screenshotsDir, filename))

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.