How can I use threading in Python?

前端 未结 19 2723
迷失自我
迷失自我 2020-11-21 04:54

I am trying to understand threading in Python. I\'ve looked at the documentation and examples, but quite frankly, many examples are overly sophisticated and I\'m having trou

19条回答
  •  暖寄归人
    2020-11-21 05:09

    import threading
    import requests
    
    def send():
    
      r = requests.get('https://www.stackoverlow.com')
    
    thread = []
    t = threading.Thread(target=send())
    thread.append(t)
    t.start()
    

提交回复
热议问题