python的坑

這個參考 https://blog.csdn.net/revilwang/article/details/37884127python

============================app

單個  tuplex .net

============================code

好比這個 這個會報錯blog

threads = []
    for stock_name in stock_name_list:
        print(stock_name)
        th = threading.Thread(target=requestOneStock,args=(stock_name))
        threads.append(th)

TypeError: requestOneStock() takes 1 positional argument but 6 were givenget

緣由是單個元組 不是以()來識別的 而是以逗號來識別的 因此要這麼改it

        th = threading.Thread(target=requestOneStock,args=(stock_name,))io

就能夠了class

相關文章
相關標籤/搜索