What do you want to save?
Add Code snippet
New code examples
-
Python 2021-10-11 21:04:06
Python3 - Multi Threaded Programming
#!/usr/bin/python3 import queue import threading import time exitFlag = 0 class myThread (threading.Thread): def __init__(self, threadID, name, q): threading.Thread.__init__(self) self.threadID = threadID self.name = name sel... Add solution -
Python 2021-10-10 03:43:03
call the api parallel in python
from concurrent.futures import ThreadPoolExecutor as PoolExecutor import http.client import socket def get_it(url): try: # always set a timeout when you connect to an external server connection = http.client.HTTPSConnection(url, timeo... Add solution -
Python 2021-10-06 23:20:02
python thread with return values?
import threading import queue my_queue = queue.Queue() def storeInQueue(f): def wrapper(*args): my_queue.put(f(*args)) return wrapper @storeInQueue def get_name(full_name): return full_name, full_name t = threading.Thread(target=get_name... Add solution -
Python 2021-09-29 09:48:04
launch a script from python using threading
#!/usr/bin/python import threading import time exitFlag = 0 class myThread (threading.Thread): def __init__(self, threadID, name, counter): threading.Thread.__init__(self) self.threadID = threadID self.name = name self.counte... Add solution -
Python 2021-09-22 10:03:02
multithread python3
import timeimport threadingdef calc_square(number): print("Calculate square numbers: ") for i in numbers: time.sleep(0.2) #artificial time-delay print('square: ', str(n*n))def calc_cude(number): print("Calculate cude numbe... Add solution