1. Preparation
Pycharm version 2.7 or higher.
(2) A project has been created.
Create a Python File (Alt+Insert→Python File)
2, generate source code
First, we instantiate a class and Pycharm immediately displays a red bulb to suggest quick completion:
Here we want to create a class, select the corresponding prompt command, Pycharm automatically creates a class by name:
Next we call the member function of the class (normally, once you enter a dot after the class name, Pycharm’s code completion mechanism lists the currently available function names, but in this case the member function has not yet been created in the class) :
In the same case, select create the method and watch how PyCharm generates the member function:
Next we are going to add a member variable “color” to our class. Pycharm prompts us to create a member variable:
OK, Pycharm is smart enough to create the variable add — creates a constructor:
Finally, you can also create a global function using Pycharm:
The original reference: CSDN blog blog.csdn.net/u013088062/…
This article is from SDK Community (www.sdk.cn/)