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
Subscribe to Blog updates
Thanks, we've got you!
Striving For Better C++ Code, Part II: Function Summaries to Speed Up the Data Flow Analysis
This is the second blog post in the series dedicated to Data Flow Analysis (DFA) and its implementation in CLion. Read the first part here: Striving For Better C++ Code, Part I: Data Flow Analysis Basics Striving For Better C++ Code, Part II: Function Summaries to Speed Up the Data Flow Analysi…
Striving For Better C++ Code, Part I: Data Flow Analysis Basics
CLion comes with a built-in data flow analyzer, which runs constantly when you are writing your code and helps improve your code’s quality. It can reveal various code problems that might later lead to runtime issues, security breaches, and other vulnerabilities. Examples of these useful checks are c…
IDE Features Trainer and Other Improvements in CLion 2023.3 EAP4
Brush up your knowledge of essential IDE functionality easily by using the brand-new IDE Features Trainer.