How to execute a specific file in a project created with Sublime Text 2. (Command + B without settings will always execute open files)
If you set "build_systems" as follows in "Project> Edit Project" from the menu, "app.py" at the root of the project will always be executed. And make the project file the root directory.
{
	"folders":
	[
		{
			//name
			"name": "stg001",
			//Directories to include in the project
			"path": ".",
			//Excluded directories
			"folder_exclude_patterns": [".ropeproject"],
			//Files to exclude
			"file_exclude_patterns": ["*.bmp", "*.png ", "*.wav", "*.ogg", "*.sublime*"]
		}
	],
	//Project-specific settings
	"settings":
	{
		"tab_size": 4
	},
	//Project-specific build settings
	//reference(http://y-anz-m.blogspot.jp/2012/11/sublime-text-2-typescript.html)
	"build_systems":
	[
		{
			"name": "stg001",
			// app.Always run py
			"cmd": ["python", "-u", "$project_path/app.py"],
			//Root the folder containing the project files
			"working_dir": "$project_path",
			"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
			"selector": "source.python"
		}
	]
}
Build TypeScript with Sublime Text 2
Recommended Posts