Tag Archive: Python

  • Join 2 Python lists together using nested loops

    In this blog post I will show you how to join two 2D Python lists together. The code is in the screenshot below. Lines 1 – 2 are two lists that are going to be joined, line 3 is an empty list where the output will be appended to. Lines 4 – 5 are two loops (one nested inside the other) which cycle through the records in both lists, line 6 checks whether the first items (index 0) in the two records from each list that are currently i…

    » Read more
  • How to delay a Python loop

    In this blog post, I will run through 3 different ways to execute a delayed Python loop. In these examples, we will aim to run the loop once every minute.To show the delay, we will print out the current datetime using the datetime module. 1 – SleepThe sleep function from Python’s time module pauses the Python execution by the number of seconds inputted. The example below pauses the script for 60 seconds. The above script has a 60 second…

    » Read more