To run Python code from Sublime Text 2 you can follow the given steps:-
Go to Sublime Text’s Tools -> Build System -> and (choose) Python then:
To Run the code following the given steps:
Tools -> Build -or- Ctrl + B CMD + B (OSX)
The above step will start your file in the console which should be at the bottom of the editor.
To stop the code from running follow the below-mentioned steps:
Ctrl + Break or Tools -> Cancel Build Fn + C (OSX)