Skip to content

Instantly share code, notes, and snippets.

@romantomjak
Last active September 11, 2018 09:17
Show Gist options
  • Save romantomjak/45e04aad8cb53bf1b39a to your computer and use it in GitHub Desktop.
Save romantomjak/45e04aad8cb53bf1b39a to your computer and use it in GitHub Desktop.
Sublime Text 3 Python VirtualEnvWrapper Build System

Open your package folder (Preferences > Browse packages) and create a file named Python (VirtualEnvWrapper).sublime-build. That will be our build system.

WARNING: Make sure your sublime project name is the same as virtualenvwrapper project name!

Now copy-paste the following JSON:

{
    "shell_cmd": "~/.virtualenvs/$project_base_name/bin/python3 -u \"$file\"",
    "path": "$project_path",
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python"
}

All set! Now Ctrl+B and BOOM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment