<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                [TOC] ## 代碼技巧 ### 元組賦值 ``` s = ("hello",'word'); a,b=s print(a,b) #hello word ``` ### *args 和**kw的區別 ``` def name(*args, **kw): print(*args) # hello word print(args) # ('hello', 'word') print(*kw) # name age print(kw) # {'name': 'cpj', 'age': '12'} name('hello', 'word', name="cpj", age="12") ``` ### `__name__`作用 #打印入口文件 print(__name__) #__main__ # test3.py print(__name__) #在入口文件引入 test3 #輸出:test3 ### 轉碼 ``` a = unicode.encode(u'慕課','utf-8') print(a) #b'\xe6\x85\x95\xe8\xaf\xbe ``` ### 特定編碼寫入或讀取 ``` import codecs f = codecs.open("test.txt",'w','utf-8') ``` ### `__init__.py` 文件用法 目錄結構 ``` Phone ├ Isdn.py ├ G3.py ├ _init__.py ``` _init__.py文件 ``` from Pots import Pots from Isdn import Isdn from G3 import G3 ``` ### 字典轉json字符串 dict = {'name':'cpj','age':'12'} print(json.dumps(dict)) ### 同時遍歷兩個數組 ``` a = ['Pradeepto', 'Kushal'] b = ['OpenSUSE', 'Fedora'] for x, y in zip(a, b): print("{} uses {}".format(x, y)) ``` ### pyinstaller打包的exe太大 1. 使用 `virtualenv` 環境在環境里進行打包
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看