Pycharm is a Python Integrated Development Environment for Professional Developers and also anyone who can code in python or even learning how to code in python. There are two versions, a paid professional version or a community edition which is free for use. Though not all features in the professional version are included in the community edition. Alright, let’s dig into it.
Install Pycharm on Linux
There are two methods of installing Pycharm:
1. Using the software center
Pycharm is available for download from the Ubuntu software center in three editions: Pro version, EDU version, and CE version. All you have to do is search for Pycharm and will appear. Choose the edition you want to install and click on install, after which you will need to supply a password to proceed. Note you will need an Internet connection for this.
2. Using .tar.gz file
Download the .tar.gz file from the official Jet Brains site. Upon download, open a terminal in the download folder where the file is and type the following in the terminal to extract it:
tar -xvf pycharm-community-2017.3.1.tar.gz
You can also right-click the file and click on extract here. It will extract in the same folder as the .tar.gz file.
It will extract the file. Then open the folder and navigate to the ‘bin’ folder and open a terminal in it then type the following in the terminal to start Pycharm:
The first run of Pycharm allows you to configure Pycharm to your preferences including setting up your themes, the location of your projects and configuring the plugins you would wish to include.
You can set the theme which you prefer next, there are basically three UI themes: Intellij, Darcula, and GTK+.
You can make it easier to launch the IDE using launcher scripts but can skip it. I will later describe how to create the scripts whilst in the IDE.
You can then configure the plugins you would wish to include in your installation. The initial plugin screen will show as follows:
Upon finishing configuring, a similar window as below will be opened to create a new project, open one or check out from version control system.
Once you have chosen a project, the initial application screen you will see is as follows:
Easy launching of Pycharm In Linux
In case you downloaded a .tar.gz file, you can create a Desktop entry that makes starting Pycharm much easier than typing command from the terminal to start Pycharm. This can be accessed from Tools > Create Desktop Entry. If it doesn’t appear, you may need to restart your session.
If you prefer the starting from the command line, there is an option of creating a launcher script. To do this go to Tools > Create Launcher Script.
Features of Pycharm
Pycharm gives tips upon starting up the IDE. This can be disabled by unchecking the show tips on startup checkbox at the bottom left. The tips are useful for getting to learn the IDE in case you are learning to use the IDE.
The work area is very intuitive to work around. It features code highlighting in different colors to show the different structures of your code, highlighting errors and also shows you warnings in your code, making it easier for you to detect errors easily.
Creating a new project
To create a project, head to file > new project
When you create a new project, you can choose the environment you want to use for the project.
Pycharm File navigation
The project explorer is a powerful tool that developers can use to browse projects and files.
The navigation bar allows navigation of files quickly and is an alternative to the project view. Its quite helpful in navigation. Pressing Alt + Home quickly triggers the navigation bar allowing you to navigate using the arrow keys to quickly locate the files and folders in the project.
Pycharm Development tools
Pycharm comes with a python console where you can type in scripts as you run them. The windows can be changed to dock mode, floating mode, windowed mode or split mode depending on your preference. When you turn on docked mode, pinned mode can also be activated to pin your tools. The above is in floated mode. This can be changed from the gear icon at the far left.
Pycharm comes with an integrated terminal you can use to run the python scripts and also shell scripts right from the terminal. This makes working on your computer much easier since you don’t have to lose focus of your project since all forms of scripts can be run right from the terminal.
When you run your code, you get a run box where you can see the code results. This makes it easier to debug your code.
Pycharm has the necessary debugging tools that will assist any developer or code to easily trace where they went wrong in case code doesn’t run as expected or throws exceptions and errors. The debugger can be accessed through Run > Debug. The debug tool shows the errors thrown by the compiler in red and if successful, an exit code of 0 is thrown. Warnings are shown in yellow, errors in red and info in blue.
There are various tools to help you organize and navigate through your code much more easily using the CODE menu.
In the menu bar, there is a menu for VCS ( Version Control System) that allows you to version control your projects, collaborate, create versions of your work, manage changes and every little VCS tool you can need so that your large projects are easier to manage. The VCS tool window allows you to perform all the necessary version control actions such as commit changes, manage change lists, put resources under version control and examine differences in the files. Pycharm has VCSs such as Git, Mercurial, CVS, Subversion and Git Hub.
The above is the use of git to manage and see changes. Makes tracking changes much easier and managing commits.
All the settings are placed in settings window. It is accessed from file menu > settings. From the appearance and toolbars to tools, all the settings you need to tweak are all here. In case a setting is not obvious, you can search it up. The search tool is quite impressive.
The above is a search for proxy. Gives accurate results making it convenient and fast to change settings. There are three themes to choose from, GTK+, Darcula or Intellij.
There is the ability to include external tools for Pycharm to make your projects development a breeze.
Macros and task automation
To automate tasks you do often, you can create macros that make automation much easier, making project completion faster and much easier.
Code completion feature
Pycharm comes with an intelligent Code Completion feature that appears as you type code or can be accessed through alt + space. This makes coding easier and faster.
The Code completion feature can even work in the interactive python console.
In case you want to switch easily between your tools, Pycharm includes a switcher tool.
The Switcher is quite helpful in quickly accessing tools that you need in your projects. It is easily accessible through pressing the CTRL + TAB keys on your keyboard to access the Switcher, then quickly switch by pressing tab to change the tools.
Pycharm also allows you to start a Jupyter Notebook right from the IDE. You will need to ensure that you have a token to ensure the code can be run in the Notebook. The notebook allows you to switch between Markdown and code. Jupyter notebook is quite helpful in scientific research and recording of progress.
Support for other languages
You can use Pycharm to write websites using HTML and CSS since it provides the necessary tools and Code Completion feature supports HTML and CSS.
When you are ready to run the web app, you can open it in the browser. This will create a server in the browser so that you can try the latest changes by simply refreshing the browser.
Pycharm is a powerful Integrated Development Environment that can be used to develop Python applications, web apps, and even data analysis tools. Pycharm has everything a python developer needs to develop. The IDE is full of surprises and keyboard shortcuts that will leave you impressed and at the same time satisfied that your projects are completed on time. Good work from JetBrains. Couldn’t have done any better.