More languages, more power: Python support
CLion is known to be a cross-platform IDE for C and C++. However, the first CLion 1.5 EAP build brought the Swift support to CLion and made IntelliJ-based Swift IDE on Linux possible. Recent CLion EAP build added support for Python. Let’s take a look at the features.
Getting started with Python in CLion is way more easier than starting with Swift, since the plugin is already bundled into the IDE and is on by default. All you need is to install Python SDK and point CLion to the Python interpreter for your project:
Since CLion is using CMake project model as a basis, you still need to have a proper CMake project, and then can mix Python and C/C++.
- in Find Action dialog (
⇧⌘Aon OS X) type Registry,
- in the registry type
run.processes.with.ptyto find the parameter,
- untick the parameter there.
This is necessary for correct Python console and Python run/debug functioning.
We also observed several problems with debugger on Windows, when using Python from Cygwin. So better install it from here.
The feature set corresponds to the PyCharm IDE Community Edition and includes all the basic and essential Python editing features, as well as running, debugging and testing.
You may notice quite a lot of new settings available if filter them typing ‘python’:
Python plugin in CLion provides:
- Python code parsing and highlighting. Colors & Fonts settings will help you to configure your favourite scheme.
- Python code built-in code formatter together with the separate set of Python code style settings that support you code style preferences.
- Code completion, file structure view and various navigation actions:
- Find Usages in Python code.
- Live Templates for generating widely-used code samples with ease:
- Refactorings, including Rename, Change Signature, Extract Variable/Parameter/Constant/etc. and more.
- A huge list of code intentions and inspections with quick fixes to make your code better and raise its quality:
- Quick documentation:
and various external documentation resources.
- Python console: you can start it from Tools | Python Console or Find Action dialog, alternatively you can execute any Python code in console by simply pressing
- Run and debug for Python configurations.
- Unit testing.
Short demo below will demonstrate you some of the features:
Download the build and give it a try. Share your feedback in the comments section below. We’ll be glad to hear what you think about the Python support in CLion.
And in case you are interested in more PyCharm features, find a set of video tutorials covering PyCharm functionality and features here.
The CLion Team