Using Sublime Text 2 with Python 3 under Windows 8.1 -


i developing plugin sublime text 2 using python. default, sublime text 2 uses python 2, i'd switch python 3. there hints on how (also here on stackoverflow), none of them seem work me. maybe because using windows , there should different here?

my python.sublime-build file looks follows:

{   "path" : "c:/python34",   "cmd": ["python", "-u", "$file"],   "file_regex": "^[ ]*file \"(...*?)\", line ([0-9]*)",   "selector": "source.python" } 

it not working that. when use following code in plugin:

print('python version: ' + sys.version) 

i result

python version: 2.6.5 (r265:79096, mar 19 2010, 18:02:59) [msc v.1500 64 bit (amd64)] 

now need change? in line cmd, should python3 instead of python? or python.exe? put path python3 windows path environment variable (and not 1 python2), still output python 2.6.5.

any more ideas on that?

you confusing plugins build systems. build systems (defined in .sublime-build files) running code through external program, python or ruby interpreter, java or c++ compiler, make, or arbitrary program takes input , gives output.

a sublime plugin program written in python executed sublime's internal python interpreter, , makes use of api perform actions within sublime, such code completion, linting, interacting version control systems git, etc. sublime text 2 uses python 2.6.5 internally, while st3 uses python 3.3.3.

if wanting write plugin, strongly advise use st3. quite stable (i have been using exclusively on year now), has many feature improvements on st2, , uses python 3 scripting language. api thread-safe, leading better performance when have many plugins running simultaneously, crash in 1 won't bring whole system down. there no development or bug-fixing work being done on st2 (in fact, sublime's author jon skinner has said in planning stages st4 now), while st3 being developed quite rapidly, 17 new builds having been released since end of january. major new features have been released, including tooltip api mini-html formatting, new language syntax definition format, improved error messages around, major changes in build systems, , bunch of tweaks on place.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -