from multiprocessing import Process
import time
class CustomProcess(Process):
def __init__(self):
super().__init__()
def __enter__(self):
return self
def __exit__(self, exc_type, exc_val, exc_tb):
print(exc_type, exc_val, exc_tb)
driver.do_something
def drop():
driver=**anything**
if __name__ == '__main__':
with CustomProcess() as process:
s=process(target = drop, args = (self.lineEdit.text(),proxy,m,p,ii))
s.start()
time.sleep(10)
s.terminate()
s.join()