How to use Atom for Python?

Every developer’s ultimate requirement is that they shouldn’t have to open a thousand windows in the background whenever they work on code and then being hassled into moving back and forth with them. But what if everything you could ever dream of could be merged into a single platform? How would it work out for you?

What is Atom

Atom is a dedicated compiler than can run all types of repositories such as Python, C++, Java, and many more. Atom is known as one of the best Python IDE. It supports packages developed in various programming languages. Most of these packages are freely available and built by the open-source communities.

Many developers from around the world use Atom for Python and also for the sake of web development. Even if you code in different languages and work towards using various repositories and compilers, Atom can fulfill all these requirements. That is why the questions for how to run Python in Atom? Are becoming more and more consistent on the internet forums.  

It will be thoroughly discussed momentarily, so if you landed here searching for how to run a python script in Atom? You are definitely in here for a treat.

Setting up atom for python

Atom is a free and open-source text and source code editor that can be downloaded for Windows, Mac, and Linux. It supports all three operating systems. Remember that you have to download the version that comes with the support for plugins written in Node.js embedded in Git Control and developed by the GitHub. Even if you can’t find the packages embedded into the current download of your Atom program, these can be downloaded later on using the Atom’s UI. Package support makes Atom prominent IDE for Python and other scripting language. Please read more about Atom, Sublime Text and Bracket comparison.

Atom packages for python

Setup Atom for Python

You can go to the settings tab to have a view of the packages that are listed there. Then according to your project requirements, you can download atom python package.

Download the code checker / atom python linter

Install Python Linter on Atom

Install a dedicated tool for flagging the coding errors and bugs. A whole list of languages is available on the Atom’s main website, where complete support for additional language is provided. The purpose of the atom python linter is to offer a top-notch application to find and fix bugs. Few of the Atom Python linter pakcages:

Download and setup script package

Setup script package in Atom

With the help of a script package running on your Atom interface, you can run different variations of your code.

For instance, you can run the entire code or small piece by compiling them separately. This way, you will test your code within the Atom’s interface instead of going off to a separate compiler.

It means that instead of running the complete iterations of the code, you can run the snippets or small part of the code.

Download Atom-File-Icons package

Setup Atom-File-Icons package in Atom

If you are familiar with different IDE and new to atom, you can download file icon pakcage to make it more usage. Different icons can be downloaded and visualized according to separate UI or your own choice.

Download a syntax highlighting theme

Setup syntax highlighting theme in atom

If you want to work on your code carefully, download the syntax highlighting theme. It will add the capability to highlight the code text and better apprehend the code to find other errors and customize the whole experience.

Version control support

Setup Version control support in Atom

Version control is required if you are working on multiple projects at the same time. If you find yourself going back and forth with GitHub, GitLab, and Bitbucket, you need to download the version control support. You can take a search for these repositories from the Atom’s resource page. Atom python packages for version control are:

How to Run Python in Atom

It might come out as a little complicated process for many people. If you have setup the Atom and installed various packages to Python, but haven’t run python on atom yet. Follow the steps below.

Download and install Python

Python can be installed from the official site. If you are using Linux, install Python through package managers (however, Python is usually pre-installed in Linux and Mac).

If you’re a Windows user, don’t forget to add python.exe on your %PATH%.

Install Atom and setup script package

Follow the steps above to install and configure Atom.

To compile and run programs, the Atom community provides different packages. In this example we will use script to run python code.

Go to Atom> Preferences> Install. It could differ for different operating system.

alternatively, You can press ctrl+shift+P and then click on the installed package.

Install Python in Atom

Enter script in the search bar and install it. When it is installed, it should be listed under “Packages” in the settings panel.

Install Script package in Atom

On macOS or Linux, you can also use apm command to install the package.

Execute python file in atom

Select the directory where you want to save the Python files.

Run Python Script in Atom
  1. Click File and select “Add Project Folder” and select the directory from the browse window to set the root directory for the project.
  2. You should see a directory tree structure in left panel. if you don’t see the left panel, you can toggle it by selecting View> Switch Tree View.
  3. To create new file, right-click on the folder and select ‘New File’. Enter and update the file with the following code: print("Running Python code in Atom")
  4. Press CTRL+ SHIFT+ B to run the script. Alternatively, you can run the script by typeing “Script: Run in View > Toggle Command Palette
Run Python in Atom terminal