O'Reilly logo

Mastering PyCharm by Quazi Nafiul Islam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing code

This section has been purposely kept short and only showcases three powerful features that many PyCharm users are not completely aware of. The first two features are very simple and require us to simply use a keyboard shortcut, while the other feature requires a little more work.

Refactoring

Refactoring is one of PyCharm's most powerful features and its capabilities go beyond a single file. One of the simplest ways to see this feature at work is renaming a variable or a function:

def add_one(n):
    return n + 1


def foo(func, n):
    return func(n)


foo(add_one, 2)

In the preceding example, we want to change the function name foo to apply (because it makes more sense). This is of course a simple example, but helps prove a point.

This brings up ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required