Python Forum
Timestamp doesn't change with each loop
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Timestamp doesn't change with each loop
#3
(Aug-23-2017, 05:36 PM)ichabod801 Wrote: You have to call datetime.datetime.now() each time through the loop.

definitely this.... I came across it the other day too. I called the time towards the start of the script so it only loaded once and wasn't in the loop. calling the time within the loop pulls the time everytime it loops (i used it as a filename timestamp)
Reply


Messages In This Thread
RE: Timestamp doesn't change with each loop - by bowen73 - Aug-23-2017, 06:58 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  error in timestamp Led_Zeppelin 3 3,394 Jun-15-2022, 08:28 PM
Last Post: deanhystad
  error in timestamp Led_Zeppelin 0 1,072 Jun-10-2022, 07:59 PM
Last Post: Led_Zeppelin
  For Loop Works Fine But Append For Pandas Doesn't Work knight2000 2 2,158 Dec-18-2021, 02:38 AM
Last Post: knight2000
  Change the varaible in For Loop quest 2 1,785 Aug-13-2021, 03:35 PM
Last Post: deanhystad
  While loop doesn't exit KenHorse 3 2,096 Jun-20-2021, 11:05 PM
Last Post: deanhystad
  Change variable value during a while loop? penahuse 2 4,206 Nov-15-2020, 11:53 PM
Last Post: penahuse
  While loop doesn't end when False Kanashi 2 2,647 Nov-21-2019, 02:38 AM
Last Post: Kanashi
  For loop in my __init__ doesn't work as expected Jessy 2 2,459 Nov-18-2019, 10:07 AM
Last Post: buran
  (Python help) Change in logic not breaking 'while' loop? btcg2807 1 1,948 Sep-18-2019, 09:43 AM
Last Post: Larz60+
  Why doesn't my loop work correctly? (problem with a break statement) steckinreinhart619 2 3,296 Jun-11-2019, 10:02 AM
Last Post: steckinreinhart619

Forum Jump:

User Panel Messages

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