Python threading 多参数传递方法

  • 今天开启线程传递参数的时候,出现了一个小问题,一直不能传递多个参数,如下

    import threading
    thread1 = threading.Thread(target=fun, args=[1, 2, 3,])
    thread1.start()
    thread1.join()
  • 要用中括号,不用用大括号,一开始的时候,用的大括号,参数不能组成数组, 在最后的参数内,还要添加逗号

原文地址:https://www.cnblogs.com/chenfulin5/p/10307754.html