how to use python on sublime text

Опубликовано: 08 Октябрь 2024
на канале: CodePoint
3
0

Download this code from https://codegive.com
Sublime Text is a popular text editor known for its simplicity and versatility. It supports various programming languages, including Python. In this tutorial, we'll guide you through setting up and using Python in Sublime Text, along with some useful features.
Before you start, make sure you have the following installed:
Install Package Control:
Open Sublime Text and install Package Control if you haven't already. Follow the instructions on the Package Control installation page.
Install Python Build System:
Open Sublime Text, press Ctrl + Shift + P (Windows/Linux) or Cmd + Shift + P (Mac) to open the command palette. Type Install Package and select Package Control: Install Package. Search for "Python" and install Python by green-coder.
Create a New Python File:
Create a new file by pressing Ctrl + N (Windows/Linux) or Cmd + N (Mac). Save the file with a .py extension, for example, my_script.py.
Select Python Build System:
At the bottom right of the Sublime Text window, select the Python build system. You can do this by navigating to Tools - Build System - Python.
Write Python Code:
Now you can start writing your Python code in the editor.
Run Python Code:
Save the file (Ctrl + S or Cmd + S) and then press Ctrl + B (Windows/Linux) or Cmd + B (Mac) to run your Python script. The output will appear in the Sublime Text console at the bottom.
Sublime Text provides code completion for Python. Type the beginning of a keyword, and then press Tab to complete it.