Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python run 2 functions at the same time

from threading import Thread

def func1():
    print('worker 1')

def func2():
    print("worker 2")

if __name__ == '__main__':
    a = Thread(target = func1)
    b = Thread(target = func2)
    a.start()
    b.start()
Comment

PREVIOUS NEXT
Code Example
Python :: how to get unix timestamp in python 
Python :: python word cloud 
Python :: remove stopwords 
Python :: install flake8 python 
Python :: unban discord.py 
Python :: time it in jupyter notebook 
Python :: discord.py presence 
Python :: python print colored text 
Python :: filter list with python 
Python :: convert text file into list 
Python :: python create map with coordinates 
Python :: python beautifulsoup write to file 
Python :: tkinter maximum window size 
Python :: image capture from camera python 
Python :: order by listview django 
Python :: spress warnings selenium python 
Python :: pyqt5 change button color 
Python :: how to check if an input is a number in python 
Python :: python read file csv 
Python :: special characters list in python 
Python :: edge driver selenium python 
Python :: plotly plot size 
Python :: turn pandas entries into strings 
Python :: How to use tqdm with pandas apply 
Python :: imbade image to jupyter notebook 
Python :: datetime one month ago python 
Python :: How to check how much time elapsed Python 
Python :: python year month day hour minute second 
Python :: python play mp3 in background 
Python :: _csv.Error: field larger than field limit (131072) 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =