Python has become one of the most popular programming languages in recent years. There is no doubt that python offers remarkable features for development in areas such as Artificial intelligence, neural networking, big data etc. To take full advantage of these features, the use of an ideal code editor is very crucial. One such exceptional code editor for python is Sublime Text.
Table of Contents
In this article, we will look at a step-by-step guide for how to setup Sublime Text for full stack Python development, how to use many of the commands, features, and keyword shortcuts that make Sublime text a powerful tool and how you can enhance some of the basic functionalities using different packages.
Sublime Text is a lightweight, cross-platform code editor mostly popular for its speed, simplicity, ease of use, and robust community support. It is an incredible code editor out of the box even without any add-ons or customizations. Still, the add-on packages and custom settings can be a great level up as it introduces various new features that can significantly enhance the functionalities. The rich package ecosystem offered by sublime text makes it very easy to configure the text editor specifically for what you want to use it for. Some of the packages are universally helpful and improve the ease of use whereas, some are very specific to a field of development.
By default, sublime text can be used with any programming language but its support for Python is considered one of the best. Keep reading below for a complete guide on how to use Sublime Text for Python.
It only takes these three words to conclude the reason for choosing Sublime Text for Python development, simplicity, Interface and customization. All the features offered by sublime text are targeted at improving the interface and as a result, it makes the code editor extremely simple. On top of that its extensive customizable options make it the ideal choice for a code editor.
Being a lightweight code editor, Sublime Text is extremely fast. The creators have also emphasized keeping the experience smooth and simple. The code editor just pops up right away when opened, unlike various other IDEs that take a significant amount of time to boot up and then welcome you with a bombardment of messages and prompts.
Its also autosave features also keep things very simple as you can just leave your work and next time it will open up from exactly where you left off so you will not have to worry about saving your work in case of a low battery or sudden power off.
Sublime Text has taken the minimalist approach for its interface. The interface offered by Sublime text is one of the cleanest interfaces you can get from a code editor. There are no unnecessary side and bottom panels that often takes up a big chunk of screen real-estate, showing only what is required, providing you with enough ground to focus on your code.
The interface also supports multiple projects separately. Opening up a new project will not close your current project instead; it opens up a separate new window for you. This separation could be very useful especially when you are referencing multiple codebases.
Sublime Text offers some rich features out of the box such as indentation preferences, spell checks, key bindings, multi-select, and file patterns. On top of that, the most highlighted customizing feature for Sublime Text is the option to extend the current functionalities using the addons called Packages. These packages can be explained as pluggable extensions to perform additional tasks. We will be discussing some packages for python later in the article.
Note: The following steps are directed for a Windows operating system. These instructions may vary for MACOS and Linux operating systems.
The latest version of Sublime Text (currently sublime text 4) can be downloaded for free from sublimetext.com. Once downloaded, run the .exe file to complete a simple installation process.
You will also need to have Python installed on your computer. If you have not already done this, you can download and install Python from python.org.
Sublime Text comes almost configured and ready out of the box. However, if you want to set the Sublime Text for Python, you should install and configure the integrated terminal. To set it up,
Similar to Package control and terminus, Sublime text offers a variety of packages to improve your python coding experience. You can install whatever packages you want using Command Palette just like the process of installing terminus mentioned above.
Package Control is the main package for installing other packages. You need to install it first before you can install anything. Once package control is installed, you will have the option available to select ‘Package Control: Install Package’. This will provide a list of available packages for Sublime Text.
Following are some of the top packages in the sublime text that you should have to get started coding in python using sublime text.
Tabnine is an AI-driven code completion package that can cut your coding time and occurring mistakes by making the best practice suggestions. It supports over 30 programming languages and Python is one of them.
Requirementstxt is a very useful package that provides syntax highlighting and easy version management for your requirements.txt files.
Anaconda is a good alternative to requirementstxt for syntax highlighting and version management. It can turn the Sublime Text editor into a full fledge Python-ready IDE by incorporating code linting, autocompletion, autopep8 formatting, McCabe complexity checker Vagrant and Docker support.
Git packages allow developers to perform some of the most common git commands from within Sublime Text. You can use commands such as git add, commit, and push right from the sublime text.
GitGutter package helps in keeping track of files that have been edited since the last commit in git. It adds a small symbol next to the line numbers that indicate the updated status of the git repository.
Auto Docstring package allows the users to create a Python docstring template for a selected method, function or class. It also allows adding docstrings for every function in a code file and change between Google and Numpy style even after the docstrings were created.
AutoPEP8 package automatically formats your Python code into the PEP 8 style guide. It allows you to choose key binding so that you can quickly lint spaces to the correct standard with ease.
SublimeLinter is an automated checking package that checks for errors and styles in your python code. It is one of the best linting packages in Sublime Text that is stable and fully supported. The timely updates also make sure that it always works with the new standards of python.
This was a comprehensive guide on how to set up Sublime Text for Python. By adding your required packages and with a little bit of tweaking, Sublime Text will be good to go for your python development.
In conclusion, Sublime Text is one of the best free code editors out there for python. The minimalistic interface makes it easy to use and distraction-free. It is also fast, and lightweight and the large ecosystem of packages can easily take care of all of your development needs.
Also Read: Using Postgresql And Python For Data Evaluation
Full Stack Java Developer | Writer | Recruiter, bridging the gap between exceptional talent and opportunities, for some of the biggest Fortune 500 companies.
Create a free profile and find your next great opportunity.
Sign up and find a perfect match for your team.
Xperti vets skilled professionals with its unique talent-matching process.
Connect and engage with technology enthusiasts.
© Xperti.io All Rights Reserved
Privacy
Terms of use