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 :: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead. 
Python :: Python sort dataframe by list 
Python :: django settings module LOGIN_URL 
Python :: formula for compounding interest in python 
Python :: load from np file py 
Python :: python get minute from datetime 
Python :: python read file without newline 
Python :: text to ascii art python 
Python :: tf.squeeze() 
Python :: python flask replit 
Python :: matplotlib wrap title 
Python :: how to make text bold in tkinter 
Python :: why when I merge my label cluster with my dataframe i get more row 
Python :: how to click in selenium 
Python :: strptime python decimal seconds 
Python :: pandas sample rows 
Python :: how to create a object in djago views model 
Python :: from sklearn.preprocessing import standardscaler error 
Python :: seaborn set title 
Python :: pandas to json without index 
Python :: RandomForestRegressor import 
Python :: Sin , Cos Graph using python turtle. 
Python :: opencv flip image 
Python :: printing with colors 
Python :: crear matriz python for 
Python :: tkinter window title 
Python :: dict to bytes python 
Python :: python pandas csv to xlsx semicolon 
Python :: python convert xd8 to utf8 
Python :: gmpy2 is prime 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =