Running Python in Sublime Text: Install Python and the SublimePython plugin. Create and write Python scripts. Run scripts from the console, menu bar, or keyboard shortcuts.
How to run Python in Sublime Text
Step 1: Install Python
Step 2: Install the SublimePython plug-in
Ctrl Shift P
(Windows) or Cmd Shift P
(Mac), then search for "Package Control" and select "Install Package." Step 3: Create Python File
. py
file (for example, hello.py
). Step 4: Write your Python script
.py
file, write your Python script. For example: <code class="python">print("Hello, world!")</code>
Step 5: Run Python script
There are several ways to run Python scripts in Sublime Text:
Ctrl
B
(Windows) or Cmd
B
(Mac) Open the console and enter python
followed by the path to your script. Ctrl
F5
(Windows) or Cmd
F5
(Mac) Run the script directly. Your Python script will now run in the console and you will see the output (for example, "Hello, world!").
The above is the detailed content of How to run sublime test in Python. For more information, please follow other related articles on the PHP Chinese website!