Lines

INVENTED
WORLDS

VS-Code (Cursor) настройка окружения

Предварительные установки

Python
Выбрать LTS
https://devguide.python.org/versions/
https://www.python.org/downloads/windows/
- галку на PATH, Customise inst
- все галки
- все галки, в C:\Python38-32
Проверить

where.exe python
python -V
which python

Git
https://git-scm.com/install/windows
При установке поменять
-use git and optional unix tools...
-checkout as-is, commit Unix-style...
Остальное оставить по умолчанию

Плагины

- Python - Code Runner (run in terminal в настройке) - Cline (для нейронок)

Пользовательские настройки

view - command palette open user settings json
{
    "files.autoSave": "afterDelay",
    "terminal.integrated.defaultProfile.windows": "Git Bash",
    "code-runner.runInTerminal": true,
    "explorer.compactFolders": false,
    "code-runner.executorMap": {
        "python": ".venv/Scripts/python -u"
    },
    "terminal.integrated.env.windows": {
        "VIRTUAL_ENV": "${workspaceFolder}/.venv",
        "PATH": "${workspaceFolder}/.venv/Scripts:${env:PATH}"
    },
    "python.createEnvironment.trigger": "off",
    "workbench.colorTheme": "Default Dark Modern",
    "cursor.semanticSearch.includePullRequests": false
}
Для линукса
{
    "files.autoSave": "afterDelay",
    "code-runner.runInTerminal": true,
    "code-runner.executorMap": {
        "python": ".venv/bin/python -u"
    },
    "git.autoRepositoryDetection": "subFolders",
    "explorer.compactFolders": false,
    "terminal.integrated.profiles.linux": {
        "bash": {
            "path": "/bin/bash"
        }
    },
    "terminal.integrated.env.linux": {
        "VIRTUAL_ENV": "${workspaceFolder}/.venv",
        "PATH": "${workspaceFolder}/.venv/bin:${env:PATH}"
    },
    "terminal.integrated.defaultProfile.linux": "bash",
    "git.suggestSmartCommit": false,
}
Чтобы ide видел автоматически из .venv \.vscode\settings.json
{
    "python-envs.pythonProjects": [
        {
            "path": ".",
            "envManager": "ms-python.python:venv",
            "packageManager": "ms-python.python:pip"
        }
    ]
}
Цвет темы: File > Preferences > Theme > Color Theme

Работа в проекте

ПКМ в области WORKSPACE -> Add folder to workspace ПКМ на папке проекта -> Open in integrated terminal Создать изолированное пространство
python -m venv .venv
ПКМ на скрипте -> Run Code

Комментарии

Комментариев пока нет.