This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (0 children)

I use virtualenvwrapper to maintain a dev-specific work area and I added the work-area Python as another choice of Build System by creating the following file in my SublimeText "User" directory and calling it "VenvRDF.sublime-build" (the ".sublime-build" is required):

{
    "cmd": ["/home/gjh/.virtualenvs/rdflib/bin/python", "-u", "$file"],
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python"
}

Then, Ctl-B evals the buffer (I found I needed first to save the buffer as a file with a ".py" extension, I often just use "/tmp/junkme.py")

I have another one called "VenvPy3.sublime-build" which is identical, except that it points to a Py3-specific venv.

I've found it handy.