Python Forum
datetime with every screenshot name
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
datetime with every screenshot name
#1
hello all ...
i write a code to take 10 screenshot from the desktop and save them to file but i need to save them in this format :

qan-2018-08-27 04:03(0)
qan-2018-08-27 04:03(1)
qan-2018-08-27 04:03(2)
...


this is my code :
import pyautogui
import datetime

q = datetime.datetime.now()

d= q.strftime("%Y-%m-%d %H:%M")



x = 0

while x<10:
    
    pic = pyautogui.screenshot(r'C:\Users\root\Desktop\test\qan-'+str(x)+'.png')
    
    x+=1 
how i cant add ( d ) here : qan-'+str(x)+'.png'
Reply


Messages In This Thread
datetime with every screenshot name - by evilcode1 - Aug-27-2018, 08:38 AM
RE: datetime with every screenshot name - by buran - Aug-27-2018, 08:47 AM
RE: datetime with every screenshot name - by buran - Aug-27-2018, 10:56 AM
RE: datetime with every screenshot name - by buran - Aug-27-2018, 05:09 PM
RE: datetime with every screenshot name - by buran - Aug-27-2018, 06:01 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  IEDriverServer screenshot ABVSVL 0 1,746 Jul-12-2020, 09:31 AM
Last Post: ABVSVL
  pyautogui.screenshot region is not working alexlu 6 6,567 Jun-04-2020, 10:46 AM
Last Post: alexlu
  What is the best way to search for a pixel in a screenshot? TheZadok42 1 2,641 May-15-2020, 12:37 PM
Last Post: scidam
  Want to take a Screenshot from a File in Linux dhiliptcs 2 2,579 Oct-21-2019, 01:22 PM
Last Post: dhiliptcs
  TypeError: unsupported operand type(s) for -: 'datetime.datetime' and 'str' findbikash 2 9,657 Sep-18-2019, 08:32 AM
Last Post: buran
  Screenshot of specific window kainev 10 19,401 Nov-30-2018, 03:07 PM
Last Post: kainev
Question [Help] Convert integer to Roman numerals? {Screenshot attached} vanicci 10 9,227 Aug-06-2018, 05:19 PM
Last Post: vanicci
  [Help] sorted() in while loop with user's input() {Screenshot attached} vanicci 5 4,034 Aug-04-2018, 08:59 PM
Last Post: vanicci
Question [Help] How to end While Loop using counter? {Screenshot attached} vanicci 2 3,101 Aug-02-2018, 10:09 PM
Last Post: vanicci

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020