1. <ul id="0c1fb"></ul>

      <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
      <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区

      RELATEED CONSULTING
      相關(guān)咨詢
      選擇下列產(chǎn)品馬上在線溝通
      服務(wù)時(shí)間:8:30-17:00
      你可能遇到了下面的問題
      關(guān)閉右側(cè)工具欄

      新聞中心

      這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
      Pythonthreading模塊的常用方法是什么

      本篇內(nèi)容介紹了“Python threading模塊的常用方法是什么”的有關(guān)知識(shí),在實(shí)際案例的操作過程中,不少人都會(huì)遇到這樣的困境,接下來就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細(xì)閱讀,能夠?qū)W有所成!

      我們提供的服務(wù)有:成都網(wǎng)站制作、成都做網(wǎng)站、微信公眾號(hào)開發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認(rèn)證、高州ssl等。為上千余家企事業(yè)單位解決了網(wǎng)站和推廣的問題。提供周到的售前咨詢和貼心的售后服務(wù),是有科學(xué)管理、有技術(shù)的高州網(wǎng)站制作公司

      說明

      1、threading.curentthread():返回當(dāng)前線程變量。

      2、threading.enumerate():返回包含正在運(yùn)行的線程的list。指線程啟動(dòng)后和結(jié)束前不包括啟動(dòng)前和結(jié)束后的線程。

      threading.activeCount():與len(threading.enumerate()有相同的結(jié)果。

      實(shí)例

      """
      python threading模塊的常用方法
      """
      import time
      import threading
       
       
      def test1():
          print('------test1-------')
          time.sleep(3)
       
       
      def test2():
          print('------test2-------')
          time.sleep(3)
       
       
      def main():
       
          t1 = threading.Thread(target=test1)
          t2 = threading.Thread(target=test2)
       
          t1.start()
          t2.start()
       
          print('activeCount: %d' % threading.activeCount())
          print(threading.enumerate())
       
          while threading.activeCount() != 1:
                  time.sleep(1)
                  print(threading.enumerate())
       
          print(threading.enumerate())
       
       
      if __name__ == '__main__':
          main()

      “Python threading模塊的常用方法是什么”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識(shí)可以關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實(shí)用文章!


      網(wǎng)頁(yè)名稱:Pythonthreading模塊的常用方法是什么
      新聞來源:http://ef60e0e.cn/article/poiscp.html
      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区
      1. <ul id="0c1fb"></ul>

        <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
        <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

        临高县| 项城市| 宝鸡市| 喜德县| 清涧县| 嘉定区| 哈尔滨市| 噶尔县| 弋阳县| 南通市| 开平市| 图木舒克市| 黔西| 西吉县| 新郑市| 湾仔区| 丰顺县| 莱西市| 得荣县| 马龙县| 扶绥县| 阜城县| 平度市| 宝山区| 平安县| 宁陕县| 依兰县| 金坛市| 巴南区| 宝应县| 贵港市| 桐柏县| 英山县| 城口县| 永登县| 甘德县| 东辽县| 师宗县| 湾仔区| 桂阳县| 彰化市|