#传参数 import threading class MyThread(threading.Thread): def __init__(self,fileName): threading.Thread.__init__(self) self.fileName = fileName print("开启线程,下载%s文件"%fileName) def run(self): print("正在下载...%s"%self.fileName) if __name__ == "__main__": t = MyThread("logo.png") t.start()