<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] ### 常見問題 本節列出常見的一些問題。 #### 如何獲取當前路徑 當前路徑可以用`'.'`表示,再用`os.path.abspath()`將其轉換為絕對路徑: ~~~ # -*- coding:utf-8 -*- # test.py import os print(os.path.abspath('.')) ~~~ 運行結果: ~~~ $ python3 test.py /Users/michael/workspace/testing ~~~ #### 如何獲取當前模塊的文件名 可以通過特殊變量`__file__`獲取: ~~~ # -*- coding:utf-8 -*- # test.py print(__file__) ~~~ 輸出: ~~~ $ python3 test.py test.py ~~~ #### 如何獲取命令行參數 可以通過sys模塊的argv獲取: ~~~ # -*- coding:utf-8 -*- # test.py import sys print(sys.argv) 輸出: $ python3 test.py -a -s "Hello world" ['test.py', '-a', '-s', 'Hello world'] ~~~ argv的第一個元素永遠是命令行執行的.py文件名。 #### 如何獲取當前Python命令的可執行文件路徑 sys模塊的executable變量就是Python命令可執行文件的路徑: ~~~ # -*- coding:utf-8 -*- # test.py import sys print(sys.executable) ~~~ 在Mac下的結果: ~~~ $ python3 test.py /usr/local/opt/python3/bin/python3.4 ~~~
                  <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>

                              哎呀哎呀视频在线观看