Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python two while loops at same time

import threading
import time

def infiniteloop1():
    while True:
        print('Loop 1')
        time.sleep(1)

def infiniteloop2():
    while True:
        print('Loop 2')
        time.sleep(1)

thread1 = threading.Thread(target=infiniteloop1)
thread1.start()

thread2 = threading.Thread(target=infiniteloop2)
thread2.start()
Comment

2 for loops at the same time in Python

for i, j in zip([1,2,3], [3,2,1]):
    print i, j

for i, j in zip(f_iterate1(), f_iterate2()):
    print i, j
Comment

PREVIOUS NEXT
Code Example
Python :: show multiple matplotlib images 
Python :: python numba 
Python :: how to plot corilation python 
Python :: how to underline text in tkinter 
Python :: python print class variables 
Python :: python generate id 
Python :: python program to add two numbers 
Python :: find closest color python 
Python :: python print utf-8 
Python :: pandas sort 
Python :: python list all files of directory in given pattern 
Python :: generate a random number in python between 0 and 1 
Python :: python get memory address of variable 
Python :: python input 
Python :: df index start from 1 
Python :: pandas read column in date format 
Python :: remove all instances from list python 
Python :: python - iterate with the data frame 
Python :: pandas convert series of datetime to date 
Python :: python os open notepad 
Python :: sum of all multiples of 3 and 5 below 100 
Python :: count values in numpy list python 
Python :: python argparse type date 
Python :: join pandas dataframe by column 
Python :: python abstract method 
Python :: python raise and exit 
Python :: python for loop even numbers 
Python :: Dropping NaN in dataframe 
Python :: factorial program 
Python :: python debugger 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =