Вы можете использовать multiprocessing.Process
.Например,
from multiprocessing import Process
from time import sleep
def s1():
count = 10
while count >= 0:
print('This is s1.')
sleep(1.)
count -= 1
def s2():
count = 5
while count >= 0:
print('This is s2.')
sleep(1.)
count -= 1
p1 = Process(target=s1, daemon=True)
p2 = Process(target=s2, daemon=True)
p1.start(), p2.start()
p1.join(), p2.join()
Вы можете запустить этот скрипт и увидеть, что две функции работают одновременно.