Book Image

Mastering PyCharm

By : Nafiul Islam
Book Image

Mastering PyCharm

By: Nafiul Islam

Overview of this book

Table of Contents (18 chapters)
Mastering PyCharm
About the Author
About the Reviewers

Improving code completion

Code completion in PyCharm is really quite something, and there are many things that you can do to enhance it even further. PyCharm normally gives you code completion options as you type:

However, if you press Ctrl + spacebar while this popup is on the screen, you will get even more code completion options:

Note that islice is not even imported, yet PyCharm can smartly tell you that you can use it, and if you chose to do so, it will be automatically imported. PyCharm also supports Cyclic Word Completion also known as Hippe Complete (Alt + /), which can prove to be very useful when you want completion in strings:

Furthermore, you can fine-tune your completion options:

Here, [1] is, by default, set to first letter, and I feel it's best to demonstrate this with an example.

With first letter, you will need to type in a capital K in order to get KeyboardInterrrupt; otherwise, it will never show up in your completion options:

But, with the setting set to None, you don't need...