how to execute in sublime code example

Example 1: how to run your code in sublime text

Step1: Go to tool this is loacted at the top 
Step2: click build 

Shorcut: a shortcut to run it is ctrl+b

Example 2: run cmd through sublime

import os, sublime_plugin
class CmdCommand(sublime_plugin.TextCommand):
    def run(self, edit):
        file_name=self.view.file_name()
        path=file_name.split("\\")
        current_driver=path[0]
        path.pop()
        current_directory="\\".join(path)
        command= "cd "+current_directory+" & "+current_driver+" & start cmd"
        os.system(command)

Tags:

Misc Example