3 Tips to be Effective In Pycharm
Tags: beginners, productivity, python
Published: 2020-01-01 11:14:40

# Introduction
I had been using PyCharm for a very long time whenever I am developing in Python. 

It's one of the best IDEs for Python out there that I had encountered. 

Which I am coming from realms of [Visual Studio][1], [Netbeans][2] & [Eclipse][3] in other programming languages. 

What blew me away for Visual Studio the most is their **debugger** & their **IntelliSense**. 

This made me set a high bar for selecting an IDE for any new programming language. 

It must have an excellent debugger and great IntelliSense.

# Tip 1 - Time Saving Shortcuts
I highly suggest you to look at [42 Tips & Tricks of PyCharm][4], [PyCharm for Productive Python Development][5] or [Mastering PyCharm][6]

It gives you a great list of shortcuts that allows you to improve your productivity in PyCharm.

I really like the `reformat code` button which reformats your code to the coding style you had selected. 

# Tip 2 - Learn to Use the Debugger
As mentioned, I choose PyCharm as my IDE is because the debugger works like what I had used in the past for visual studio.

Here are the steps to start debugging in Pycharm:

Add a red colour **breakpoint** by left-clicking your mouse in the line on where you would like the debugger to stop at.

![adding breakpoint 1][7]

Now click on the "debugger" button that which is just beside the "run" button for PyCharm to execute in the debug mode.

![execute debug mode 1][8]

If you are running the debug mode for the first time. It might prompt you to install something for the debugger to make it run faster.

Now you have a bunch of arrows in the bottom of Pycharm.

Which is called [Stepping][9]. 

This allows you to step through the execution of your program. 

From the line by line (Step Into) execution to jumping directly to the next breakpoint (Step Out).

![debugger stepping 1][10]

# Tip 3 - Using a Testing Framework
You can choose to change a different testing framework, which the default test runner is `unittest`. 

You do it by going to `Settings` -> `Tools` -> `Python Integrated Tools` -> `Default test runner`.

Once your there, a prompt will ask you to fix the problem by clicking `fix` to install the testing framework if you had not done so previously.


![change default test runner 1][11]

Another favourite of mine for PyCharm is the `autorun test` toggle button in the red circle. 

![toggle auto test 1][12]

This allows you to set **time delays** to automatically run your test cases, after writing a piece of code which is quite useful for **TDD**.

# Conclusion
I hope the tips are useful for making yourself more productive in using PyCharm.

Besides that regarding on testing portion for PyCharm. You can look at a video called [Productive pytest with PyCharm][13] that is created by both Jetbrians and Brian Okken. 

Brian is the author of the book called [Python Testing with pytest][14]. 

I pick up a few neat tricks in Pycharm when I'm selecting the default test runner as [Pytest][15]. 

Especially the part in adding the `verbose` option when running test cases for it.

If you like this article **sign up** for my [Adventurer's Newsletter](https://maxongzb.activehosted.com/f/1) for a weekly update in the area of **Python**, **Startup** and **Web Development**.

You can also **follow** me to get the **latest** update of my article on **Dev**

The original post was on [3 Tips to be Effective In Pycharm - Reading Time: 3 Mins](https://www.maxongzb.com/3-tips-to-be-effective-in-pycharm-reading-time-3-mins/) and cover image by [Photo by Web Donut on Unsplash](https://unsplash.com/photos/eSzWOpp1rgw)

# Reference
* [Netbeans][2]
* [Visual Studio][1]
* [Eclipse][3]
* [42 Tips & Tricks of PyCharm][4]
* [In Depth Screencast on Testing][16]
* [How to use PyCharm to debug your Python code][17]
* [Pytest][15]
* [Productive Pytest with PyCharm][13]
* [Python Testing with Pytest][14]


[1]: https://visualstudio.microsoft.com/
[2]: https://netbeans.org/
[3]: https://www.eclipse.org/
[4]: https://www.jetbrains.com/pycharm/guide/playlists/42/
[5]: https://realpython.com/pycharm-guide/
[6]: https://training.talkpython.fm/courses/explore_pycharm/mastering-pycharm-ide
[7]: //images.ctfassets.net/ly2f59p4unnn/pClLVibvd41fx1fByhVBt/68f245bc5d8b39ef1e7ed40b66452914/adding_breakpoint_1.png
[8]: //images.ctfassets.net/ly2f59p4unnn/7raIoW9WtnRPJB1GnFLFEU/1911fc41d2ab49d2548dd096946e3af4/execute_debug_mode_1.png
[9]: https://www.jetbrains.com/help/pycharm/stepping-through-the-program.html
[10]: //images.ctfassets.net/ly2f59p4unnn/5mGlzTYTyR8fMs5DcnAXYV/c8771072364667633b9bd25711e3777a/debugger_stepping_1.png
[11]: //images.ctfassets.net/ly2f59p4unnn/1xVT4MRXcOYkn1Kg3IoXV3/3466c7100a44416430a82b0e192e7dd2/change_default_test_runner_1.png
[12]: //images.ctfassets.net/ly2f59p4unnn/2w6LvbleaTCSN684XbLr2l/edc904d1c82f4759d2773a8dc40af7bb/toggle_auto_test_1.png
[13]: https://youtu.be/ixqeebhUa-w
[14]: https://www.amazon.com/Python-Testing-pytest-Effective-Scalable/dp/1680502409/ref=sr_1_1?crid=151MAX5I9512I&keywords=python+testing+with+pytest&qid=1577871049&sprefix=python+testing+with+p%2Caps%2C-1&sr=8-1
[15]: https://docs.pytest.org/en/latest/
[16]: https://blog.jetbrains.com/pycharm/2016/04/in-depth-screencast-on-testing/
[17]: https://www.freecodecamp.org/news/debugging-with-pycharm-be282bcd6172/