Home > Article > Development Tools > How to run python code in sublime
Running Python code in Sublime Text requires the following steps: Install the Python interpreter. Set the Python interpreter path in settings. Save the Python code to a .py file. Create a build system starting with "python". Press Ctrl B (Windows) or Cmd B (Mac) to run the code.
How to run Python code in Sublime Text
In order to run Python code in Sublime Text, you can use Following steps:
1. Install the Python interpreter
2. Setting up Sublime Text
<code>"python_interpreter": "python.exe"</code>
3. Save the Python file
.py
file. 4. Create a build system
<code>"python" "$file"</code>
5. Run the code
Ctrl
B
(Windows) or Cmd
B
(Mac) to run the build system. Other options:
Ctrl
~
) and enter the following command to run the code: <code>python <path_to_your_python_file.py></code>
Follow these steps and you can easily run Python code in Sublime Text.
The above is the detailed content of How to run python code in sublime. For more information, please follow other related articles on the PHP Chinese website!