w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Sublime text3 and virtualenvs

You're looking for custom build systems.

From the menu bar, click Tools -> Build Systems -> New Build System...

Fill out the template it gives and save it under any filename ending in .sublime-build to your User folder.

Here is the documentation for making custom build systems:

http://docs.sublimetext.info/en/latest/reference/build_systems.html

I recommend making a custom build system for python scripts, then add variants for each virtual env you want. (see variants http://docs.sublimetext.info/en/latest/reference/build_systems.html#variants)

One you make a build system, you can switch them from

Tools -> Build Systems

(if not auto detected) and use the Command Palette (default ctrl + shift p) to switch between variants.

The only "gotcha" is the "cmd" parameter to describe what command to run. By default it takes an array of strings to run as a command, but you can use "shell_cmd" instead to just use a string of how you would run it via command line.





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.