111-python-面向对象开启多线程

from threading import Thread

class Alls(Thread):
    def __init__(self,age):
        super().__init__()
        self.age = age

    def run(self):
        print('ok')
        print(self.age)

a = Alls(2)
a.run()

  

posted @ 2018-12-15 17:18  _Q  阅读(350)  评论(0编辑  收藏  举报