1 Replies - 529 Views - Last Post: 15 January 2022 - 10:19 PM Rate Topic: -----

#1 valen80000   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 07-March 19

Executing Tasks Through Arrays

Posted 15 January 2022 - 09:22 PM

Hello Everyone,

I am currently working on a Python Project using arrays and am in need of assistance.

I have two arrays - one with a list of times and the other with a list of tasks. How can I schedule each task in the array to correspond and execute based on the time in the other array. For example:

time = [9:00, 10:00, 11:00]
task = [Task1, Task2, Task3]

Tasks run chronologically

9:00 - Task1
10:00 - Task 2
11:00 - Task 3

Do I do something like:

time = [9:00, 10:00, 11:00]
task = [Task1, Task2, Task3]
queue = [time, task]

for [t, ta] in queue
    next(task)




I need to use arrays to accomplish this.

Thanking anyone in advance for any assistance.

Is This A Good Question/Topic? 0
  • +

Replies To: Executing Tasks Through Arrays

#2 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 16503
  • View blog
  • Posts: 65,458
  • Joined: 12-June 08

Re: Executing Tasks Through Arrays

Posted 15 January 2022 - 10:19 PM

You could very well have a class that consists of a time and a task. Then your queue/array/collection is consists of instances of those custom classes.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1