XIVN1987

Sublime 中如何快速切换 Python 解释器

  •  
  •   XIVN1987 · Nov 12, 2019 · 3987 views
    This topic created in 2443 days ago, the information mentioned may be changed or developed.

    vscode 可以在左下角下拉框中选择使用哪个 Python 解释器,,非常方便、快捷

    请问 Sublime 有没有类似的功能

    5 replies    2019-11-14 10:39:05 +08:00
    jfcherng
        1
    jfcherng  
       Nov 13, 2019
    你是說 console 裡的 python 解釋器?還是 build 的?

    conosle 的話沒得選,ST 3 只有 python 3.3,ST 4 可以用 3.8。
    build 的話可以寫 variants,見 https://www.sublimetext.com/docs/3/build_systems.html#options。
    jfcherng
        2
    jfcherng  
       Nov 13, 2019
    最後的句號被識別為 URL 了...
    XIVN1987
        3
    XIVN1987  
    OP
       Nov 13, 2019
    @jfcherng

    执行的话我用 py.exe + shebang 完美解决了

    这里问的是智能补全插件 SublimeJEDI 使用的 Python 解释器快速切换,,
    jfcherng
        4
    jfcherng  
       Nov 13, 2019
    https://github.com/srusskih/SublimeJEDI#settings

    Project settings? 雖然功能和你的要求不盡相同
    XIVN1987
        5
    XIVN1987  
    OP
       Nov 14, 2019
    给 SublimeJEDI 添加了快速 Python 切换功能,已 Pull,希望能合并

    https://github.com/srusskih/SublimeJEDI/pull/305

    具体用法如下:

    ### Quick Select/Switch Python

    Specify python interpreters used now and avaliabe

    ```json
    // User/sublime_jedi.sublime-settings
    {
    "python_interpreter": "D:/Python36/python.exe",
    "python_interpreters":
    [
    "D:/Python27/python.exe",
    "D:/Python36/python.exe",
    "D:/Python27/venv/Scripts/python.exe",
    "D:/Python27/vexe/Scripts/python.exe",
    "D:/Python36/venv/Scripts/python.exe",
    "D:/Python36/vexe/Scripts/python.exe",
    "D:/Python36/vweb/Scripts/python.exe"
    ]
    }
    ```

    And then, you can quick select/switch python by input 'SublimeJedi: Select Python' in command palette

    When a python file is opened or activated, the python interpreter used by JEDI will show on statusbar
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3327 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 12:26 · PVG 20:26 · LAX 05:26 · JFK 08:26
    ♥ Do have faith in what you're doing.