Fork me on GitHub
Credit and license

Lesson on automated IDE (PyCharm): Good to know: PyCharm features

Overview

Questions
  • How to ease Your life?
Objectives
  • Some of the main features of PyCharm are introduced.

PyCharm setup

In this part basic functionality of IDE is demonstrated and gone through.

Intelligent Coding Assistance

  • Code completion [0]
  • On-the-fly error highlighting [1]
  • Fast and Safe Refactorings [2]

Built-in Developer Tools

  • Visual Debugger [3]
  • VCS + Local History [4]
  • Profiler [5]
  • Vagrant [6]
  • VirtualEnv [7]

Customizable and Cross-platform IDE

  • Plugins

Intelligent Coding Assistance

Action Win/Lin keys Mac keys
To find any action inside the IDE use Find Action Ctrl + Shift + A ⌘ ⇧ A
Show intention actions and quick-fixes Alt + Enter ⌥ Enter
Basic code completion (the name of any class, method or variable) Ctrl + Space ⌃ Space
Go to declaration (the name of any class, method or variable) Ctrl + B , Ctrl + Click ⌘ B , ⌘ Click
Select successively increasing code blocks Ctrl + W ⌥ ↑
Find/Replace Ctrl + F / Ctrl + R ⌘ F, ⌘ R
Go to class Ctrl + N ⌘ O
Go to line Ctrl + G ⌘ L

Intelligent Coding Assistance

On-the-fly error highlighting [1]

  • concept : PEP8 (style guides) - is a StyleGuide for Python. A tool that validates code against it goes by the same name. (Python wiki)
  • concept : Pylint (style guides) - Pylint is a tool that checks for errors in Python code, tries to enforce a coding standard and looks for code smells. It can also look for certain type errors, it can recommend suggestions about how particular blocks can be refactored and can offer you details about the code’s complexity. (Pylint wiki)
Action Win/Lin keys Mac keys
Reformat code Ctrl + Alt + L ⌘ ⌥ L
  • code analysis : Code -> Inspect Code
  • errors highlighting

Intelligent Coding Assistance

Fast and Safe Refactorings [2]

Action Win/Lin keys Mac keys
Change Signature Ctrl + F6 ⌘ F6
Surround with... Ctrl + Alt + T ⌘ ⌥ T
Extract Constant Ctrl + Alt + C ⌘ ⌥ C
Extract Method Ctrl + Alt + M ⌘ ⌥ M
Safe delete Alt + Delete ⌘ Delete
Create test Ctrl + Shift + T ⌘ ⇧ T

Built-in Developer Tools

Visual Debugger [3]

  • concept : breakpoint - a breakpoint is an intentional stopping or pausing place in a program, put in place for debugging purposes. (Wikipedia)

  • run in debug mode : Run -> Debug ‘…‘
  • take a look
  • remove debugging
Action Win/Lin keys Mac keys
Resume program F9 F9
Step over/into F8 / F7 F8 / F7
Step out Shift + F8 ⇧ F8
Evaluate expression Alt + F8 ⌥ F8
View breakpoints Ctrl + Shift + F8 ⌘ ⇧ F8


  • set value

Built-in Developer Tools

VCS + Local history [4]

  • VCS integration (not limited to Git)
  • Local History

Built-in Developer Tools

Profiler [5]

  • run in debug mode : Run -> Profile ‘…‘
  • take a look at results

Built-in Developer Tools

Vagrant [6]

  • demo : Tools -> Vagrant -> … (PyCharm Professional only)

VirtualEnv [7]


Customizable and Cross-platform IDE

Plugins

Action Win/Lin keys Mac keys
Open Settings dialog Ctrl + Alt + S ⌘ ,


  • Plugins, plugins are everywhere…

  1. Python Wiki - http://python.wikia.com/wiki/PEP8
  2. Wikipedia - https://en.wikipedia.org/wiki/Breakpoint
  3. Pylint - https://pylint.readthedocs.io/en/latest/intro.html