1. Two ways to achieve concurrency
# The first from multiprocessing Import Process Import Time class MyProcess(Process): def run(self): print(f'{name} is running') time.sleep(3) print('over.....') if __name__ == '__main__': p = MyProcess () p.start() print ( ' main thread ' ) # Second from multiprocessing Import Process Import Time def text(name): print(f'{name} is running') time.sleep(2) print('over....') if __name__ == '__main__': p = Process(target=text,args = ('hz',)) p.start() print ( ' main thread ' )