Full Pycharm Tutorial (--pycharm) Code Auto-generation of the editor function

Source: Internet
Author: User

1. Preparatory work

(1) The Pycharm version is 2.7 or higher.

(2) A project has been created.

(3) Creating Python files (alt+insert→pythonfile)

2. Generate Source code

First, we instantiate a class, and pycharm immediately displays a red light bulb to give a quick completion suggestion:

Here we want to create a class that selects the corresponding prompt command, and Pycharm automatically creates a class based on its name:

Next we call the member function of this class (in general, once you enter a point number after the class name, the Pycharm's code completion mechanism lists the currently available function names, but here the member functions we use are not yet created in the class):

In the same situation, choose to create the method, and then observe how pycharm generates member functions:

Next we are going to add a member variable "color" to the class, and Pycharm will prompt us to create a member variable:

Ok,pycharm Intelligent completion of the creation of the variable added--Creates a constructor function:

Finally, you can also create a global function with Pycharm intelligence:

Full Pycharm Tutorial (--pycharm) Code Auto-generation of the editor function

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.