Home Download Buy Blog Forum Support

Changing the Console's version of Python

Changing the Console's version of Python

Postby Daftatt on Fri Dec 02, 2011 7:43 pm

I noticed that the console in sublime is using a zip of python 2.6
How do I change it so the console uses a different version of python like Python 3.2.2?
Daftatt
 
Posts: 25
Joined: Tue Nov 29, 2011 2:28 am

Re: Changing the Console's version of Python

Postby jps on Fri Dec 02, 2011 10:53 pm

This can't be changed, it's an integral part of the editor.
jps
Site Admin
 
Posts: 3067
Joined: Wed Mar 19, 2008 12:33 pm

Re: Changing the Console's version of Python

Postby Daftatt on Mon Dec 05, 2011 6:45 pm

Hmmm... Well then how about a simple way to press a button and run the code in sublime text in the python.exe that is in the windows path variables? Which for me is the 3.X version.
Daftatt
 
Posts: 25
Joined: Tue Nov 29, 2011 2:28 am

Re: Changing the Console's version of Python

Postby guillermooo on Mon Dec 05, 2011 7:12 pm

The default build system for Python should do that for you. Make sure it's the selected build system and press F7. If you want to *see* the actual console, you will need to create your own build system, though, and use that instead.

http://sublimetext.info/docs/en/core/build_systems.html
guillermooo
 
Posts: 728
Joined: Thu Jul 23, 2009 9:06 am

Re: Changing the Console's version of Python

Postby Daftatt on Tue Dec 06, 2011 7:27 pm

Thanks, I think I'll do the latter
Daftatt
 
Posts: 25
Joined: Tue Nov 29, 2011 2:28 am

Re: Changing the Console's version of Python

Postby guillermooo on Tue Dec 06, 2011 9:42 pm

An quick option:

pythonc.bat
Code: Select all
start cmd /c "python.exe -u %1 && pause"


Python Console Build System.sublime-build
Code: Select all
{
   "cmd": ["C:\\users\\<YOU>\\path\\to\\pythonc.bat", "$file"]
}


It isn't perfect, but it's simpler than writing a custom build command...
guillermooo
 
Posts: 728
Joined: Thu Jul 23, 2009 9:06 am

Re: Changing the Console's version of Python

Postby guillermooo on Tue Dec 06, 2011 9:45 pm

It's worth noting, however, that you'll lose the ability to navigate errors with F4, because you aren't capturing any error info.
guillermooo
 
Posts: 728
Joined: Thu Jul 23, 2009 9:06 am

Re: Changing the Console's version of Python

Postby Daftatt on Wed Dec 07, 2011 6:49 pm

you can just do jerryrigging debugging, and by that I mean taking a screenshot before the cmd closes and viewing the error in paint ;)
Daftatt
 
Posts: 25
Joined: Tue Nov 29, 2011 2:28 am

Re: Changing the Console's version of Python

Postby guillermooo on Wed Dec 07, 2011 8:09 pm

Haha... I've done that!
guillermooo
 
Posts: 728
Joined: Thu Jul 23, 2009 9:06 am


Return to Technical Support

Who is online

Users browsing this forum: thecoder149 and 30 guests