Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
change timing on py script
#2
this code has bugs:
the function print_wait uses hour as an argument.
inside that function, the following code:
nxt  += timedelta(hour = 3 )
will cause an 'invalid keyword argument' error (if it ever gets executed) because you
cannot assign a value to an argument

In addition, the code uses sleep which stops execution of the script until timed out.
You'd be better off rewriting, and using sched: https://docs.python.org/2/library/sched.html
Reply


Messages In This Thread
change timing on py script - by kwfreverie - Dec-16-2017, 07:06 PM
RE: change timing on py script - by Larz60+ - Dec-16-2017, 07:28 PM
RE: change timing on py script - by kwfreverie - Dec-16-2017, 07:35 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question Timing actions with Python dangermaus33 0 1,041 Apr-19-2022, 10:08 PM
Last Post: dangermaus33
  Inconsistent counting / timing with threading rantwhy 1 1,807 Nov-24-2021, 04:04 AM
Last Post: deanhystad
  Synchronization/Timing Problem quest 5 3,085 Mar-31-2021, 10:26 PM
Last Post: quest
  Timing of a while loop stylingpat 4 6,981 Mar-31-2021, 10:48 AM
Last Post: stylingpat
  Assigning Data from one column to another with different associated timing interval alexafshari 1 1,991 Apr-30-2020, 03:59 PM
Last Post: pyzyx3qwerty
  Change mouse move speed in guibot script rulltartan 1 2,777 Mar-30-2020, 01:51 PM
Last Post: pevogam
  Cannot Change Python script to exe using Pyinstaller omar_mohsen 3 2,448 Dec-19-2019, 01:05 PM
Last Post: buran
  Frequency and timing of psycopg2 commits acecase 0 2,247 Nov-01-2019, 05:50 PM
Last Post: acecase
  Perpetual timing Mark17 3 2,964 Oct-24-2019, 03:46 PM
Last Post: Gribouillis
  Timing input Mark17 2 2,335 Oct-23-2019, 08:25 PM
Last Post: Mark17

Forum Jump:

User Panel Messages

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