多线程理解,以及代码实现

import threading


class MyThreading(threading.Thread):
def run(self):
print("Hello,world!")


my_threading = MyThreading()
my_threading2 = MyThreading()

my_threading.start()
my_threading2.start()


def my_fun():
print("I LOVE YOU")


threading.Thread(target=my_fun).start()
posted @ 2022-07-01 13:47  故y  阅读(25)  评论(0)    收藏  举报