Steps to run a program in Sublime Text: Create and configure a Build System to define the commands and file paths required to run the script; save the build system file; run the program using shortcut keys or through the Tools menu .
How to run programs in Sublime Text
<code>步骤 1:设置构建系统</code>
In Sublime Text, go to Tools > "Build Systems" > "New Build System" to create a new build system.
<code>步骤 2:配置构建系统</code>
Add the following code to the build system file to run the script:
<code>{ "cmd": ["python", "$file"], "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", "selector": "source.python" }</code>
Replace "python" with the interpreter you want to use and "$file" with the file you want to run path.
<code>步骤 3:保存构建系统</code>
Name the build system file "MyBuildSystem.sublime-build" and save it in Sublime Text's "Build System" folder.
<code>步骤 4:运行程序</code>
Run the program using the shortcut "Ctrl B" (Windows) or "Cmd B" (Mac) or by going to Tools > Build.
The above is the detailed content of How to run sublime test program. For more information, please follow other related articles on the PHP Chinese website!