Best Code Editor For Mac For Python 2018

This guide will introduce you to the PyCharm integrated development environment, which can be used to develop professional applications using the Python programming language. Python is a great programming language because it is truly cross-platform. It can be used to develop a single application which will run on Windows, Linux and Mac computers without having to recompile any code.

PyCharm is an editor and debugger developed by Jetbrains, who are the same people who developed Resharper. Resharper is a great tool used by Windows developers for refactoring code and to make their lives easier when writing .NET code. Many of the principles of Resharper have been added to the professional version of PyCharm.

How to Install PyCharm

Code

This guide to installing PyCharm will show you how to get PyCharm, download it, extract the files and run it.

The Welcome Screen

When you first run PyCharm or when you close a project you will be presented with a screen showing a list of recent projects.

A lightweight Text/Code Editor (Like NotePad ++ for Windows) is a way more practical way to create simple proyects or make light modifications to code. I even took notes at the university on NotePad ++ and use it everyday not just for coding.

  • There are a ton of IDE available for Mac operating system also, but many new programmers still confused to pick best Python IDE for mac os x, best Python IDE Mac for beginners and good Python IDE for Mac. Don’t worry here you will find the answer to all your questions.
  • Sep 07, 2018  Best Free Text Editors in 2018 All of the options below support most major programming languages, but none of them support every single language. Before you download a text editor, check the maker’s website to ensure that your language of choice is supported.
  • Abder-Rahman takes a look at the most popular code editors used by Python experts, and explains how to set up the most popular: Sublime Text.

You will also see the following menu options:

  • Create New Project
  • Open A Project
  • Checkout From Version Control

There is also a configure settings option which lets you set up the default Python version and other such settings.

Creating A New Project

When you choose to create a new project you are provided with a list of possible project types as follows:

  • Pure Python
  • Django
  • Flask
  • Google App Engine
  • Pyramid
  • Web2Py
  • Angular CLI
  • AngularJS
  • Foundation
  • HTML5 Boilerplate
  • React Starter Kit
  • Twitter Bootstrap
  • Web Starter Kit

If you want to create a base desktop application which will run on Windows, Linux and Mac then you can choose a Pure Python project and use QT libraries to develop graphical applications which look native to the operating system they are running on regardless as to where they were developed.

As well as choosing the project type you can also enter the name for your project, and also choose the version of Python to develop against.

Open a Project

You can open a project by clicking on the name within the recently opened projects list or you can click the Open button and navigate to the folder where the project you wish to open is located.

Checking out From Source Control

PyCharm provides the option to check out project code from various online resources including GitHub, CVS, Git, Mercurial, and Subversion.

The PyCharm IDE

The PyCharm IDE starts with a menu at the top. Underneath this, you have tabs for each open project.

On the right side of the screen are debugging options for stepping through code.

The left pane has a list of project files and external libraries.

To add a file you right-click on the project name and choose New. You then get the option to add one of the following file types:

  • File
  • Directory
  • Python Package
  • Python File
  • Jupyter Notebook
  • HTML File
  • Stylesheet
  • JavaScript
  • TypeScript
  • CoffeeScript
  • Gherkin
  • Data Source

When you add a file, such as a python file, you can start typing into the editor in the right panel.

The text is all color coded and has bold text. A vertical line shows the indentation so you can be sure that you are tabbing correctly.

The editor also includes full IntelliSense, which means as you start typing the names of libraries or recognized commands you can complete the commands by pressing Tab.

Debugging the Application

You can debug your application at any point by using the debugging options in the top right corner.

Free Code Editor For Mac

If you are developing a graphical application, then you can simply press the green button to run the application. You can also press Shift+F10.

To debug the application you can either click the button next to the green arrow or press Shift+F9. You can place breakpoints in the code so that the program stops on a given line by clicking in the gray margin on the line at which you want to break.

To make a single step forward you can press F8, which steps over the code. This means it will run the code but it won't step into a function. To step into the function, you would press F7. If you are in a function and want to step out to the calling function, press Shift+F8.

While you're debugging, at the bottom of the screen you will see various windows, such as a list of processes and threads and variables that you are watching the values for. As you are stepping through the code you can add a watch to a variable so that you can see when the value changes.

Another great option is to run the code with coverage checker. The programming world has changed a lot over the years and now it is common for developers to perform test-driven development so that every change they make they can check to make sure they haven't broken another part of the system.

The coverage checker actually helps you to run the program, perform some tests and then when you have finished it will tell you how much of the code was covered as a percentage during your test run.

There is also a tool for showing the name of a method or class, how many times the items were called, and how long was spent in that particular piece of code.

Code Refactoring

A really powerful feature of PyCharm is the code refactoring option.

When you start to develop code little marks will appear in the right margin. If you type something which is likely to cause an error or just isn't well written then PyCharm will place a colored marker. Clicking on the colored marker will tell you the issue and will offer a solution.

For example, if you have an import statement which imports a library and then don't use anything from that library not only will the code turn gray the marker will state that the library is unused.

Other errors that will appear are for good coding, such as only having one blank line between an import statement and the start of a function. You will also be told when you have created a function that isn't in lowercase.

You don't have to abide by all of the PyCharm rules. Many of them are just good coding guidelines and are nothing to do with whether the code will run or not.

Best Editor For Python Programming

The code menu also has other refactoring options. For example, you can perform code cleanup and you can inspect a file or project for issues.

Code Editor For Mac

Summary

Best Code Editor For Mac

PyCharm is a great editor for developing Python code in Linux, and there are two versions available. The community version is for the casual developer, whereas the professional environment provides all the tools a developer could need for creating professional software.

Comments are closed.