# 多线程
from threading import Thread
import os


def f(n):
    print(os.getpid())
    print('current task:', n)


if __name__ == '__main__':
    t1 = Thread(target=f, args=('thread 1',))
    t2 = Thread(target=f, args=('thread 2',))
    t1.start()
    t2.start()


4fb542ada720be3d8664bd9442fc2471bfe02d2f
<mask token>

<mask token>


def f(n):
    print(os.getpid())
    print('current task:', n)


<mask token>

<mask token>


def f(n):
    print(os.getpid())
    print('current task:', n)


if __name__ == '__main__':
    t1 = Thread(target=f, args=('thread 1',))
    t2 = Thread(target=f, args=('thread 2',))
    t1.start()
    t2.start()

from threading import Thread
import os


def f(n):
    print(os.getpid())
    print('current task:', n)


if __name__ == '__main__':
    t1 = Thread(target=f, args=('thread 1',))
    t2 = Thread(target=f, args=('thread 2',))
    t1.start()
    t2.start()

# 多线程
from threading import Thread
import os


def f(n):
    print(os.getpid())
    print('current task:', n)


if __name__ == '__main__':
    t1 = Thread(target=f, args=('thread 1',))
    t2 = Thread(target=f, args=('thread 2',))
    t1.start()
    t2.start()

