Setup IDE

 

If this is the first time to use python and you have not built any python development environment, setting up IDE (Integrated Development Environment) might be a one good choice to start coding quite easily. I will introduce how to setup PyCharm, one of the major python development tool, which I am also using heavily 🙂 

Skip this section if you have already setup your python develop environment. It is ok to use favorite development environment.

 

PyCharm

 

Refer official site for the details and download the software to install it.

PyCharm supports Windows, Mac, Linux.

 

Version

There are 2 types, Free Community Edition and Paid Professional Edition. 

cite from https://www.jetbrains.com/pycharm/features/

Mainly, the difference is that professional edition supports web framework, profiling and remote (ssh) support.

In terms of our purpose, machine learning, I personally feel the necessity of each feature as follows,

  1. Web development: we do not develop web, not necessary.
  2. Profiler: it is nice to have, but profiler is necessary only when you need to optimize/tune the code behavior. Here we are just using the deep learning framework (chainer) and we can develop without profiler.
  3. Remote support: When you are accessing remote Linux server for calculation (For example you have GPU desktop PC, and accessing it from note PC). Then this feature is quite useful, developing code can be sent directly to remote PC from local PC via PyCharm. Also, you may run the code in remote environment from PyCharm GUI.

 

Summary, if you are accessing remote Linux server for calculation, it is nice to consider purchasing professional edition. Otherwise, it is good enough to use community edition.

 

Features

What is nice in PyCharm?

I just listed up useful features supported by PyCharm, 

[WIP] I’d like to explain these with animated gif in the future.

 

  • Easy to setup

GUI button to run the code, Color theme

 

  • Completion

When you are typing the method name, PyCharm shows the completion list to let user to just press TAB to complete the coding.

 

  • Type hiting, PEP 8 code format hinting

PyCharm estimates the python codes variable type, to show method completion etc.

Also, it statically analyze the code to show PEP 8 code formatting notification. You can automatically learn/write the “recommended” python way of writing.

 

  • Auto-formatting

Indent will be added automatically when you go to next line.

 

  • Customizable shortcut key binding

Emacs, vim-like key binding is also supported as default.

Really many of the functionality is supported and can be bound by shortcut key.

 

  • Live template code

You can register “live template”, which can be expanded with abbreviation, for fast coding.

 

  • Refactoring

Refactoring is one of the main strong point of PyCharm (Intelli J products).

You can change variable name on the source code at once, move the class to other file with automatically affect import dependencies etc. 

 

  • Jump around the code to see its parent definition

Source Code reading is easy.

Ctrl+Q to see the explation of methods.

Ctrl+Enter to jump the parent definition.

 

  • Debug support

Next to the “run” button, there is “debug” button to debug python script easily.

You may also visually put break point and see the variable’s value at specific point etc.

 

  • Easy project wise python version control

PyCharm saves the configuration for each project, and you may specify “conda version” for each project.

It is easy to switch python 2 and python 3 depending on the project.

 

  • Plugin support

Third-party (even you) can develop the PyCharm plugin and you can install these plugins for more convenient use.

 

 

Sponsored Links

Leave a Reply

Your email address will not be published.