They taught you how to carry out activities Pycharm template configuration

/1 Introduction/

Hey, you little friends Hello everybody, recently back many small partners plus small series of micro letter, said he wanted to use Pycharm, in addition to simple installation and setup Pycharm Pycharm interpreter, Python environment to build - Amway white Python installation of Python and Pycharm detailed tutorial , installed after Pycharm how to configure the Python interpreter simple tutorial , there is a template configuration activities, Xiao Bian think it is still very important, sorting out here for everyone to learn. If you want to learn some Pycharm of tips, articles featured in the background of columns inside a special series of articles, you can go to learn about, and

Today to bring a small fire burning dry is Pycharm activity template configuration, with a look ~

/ 2 What is the activity template /

here is the image

webp

Events template configuration .gif

A very simple example, is to enter the main keyword pycharm, it will automatically bring out some of the default code, this is the activity template configuration

Some may ask, what use is it that I can only say that people were lazy and great, this is the spirit of the old bird can write less code to write less code attitude, it can be lazy lazy attitude, we teach junior partner how to configure active template, steal more lazy, ha ha ha!

 

/ 3 Configuring Active Template Step /

1. Click on the upper left corner pycharm, open settings, as shown below.

webp

2. Search Live Template, as shown in FIG.

webp

3. Select the python, as shown below.

Look, we used a fast main input is in this configuration, as shown below.

webp


4. Click the + sign, select Live Template

webp

5. Configure Active Template

webp

 

/ Example 4 Effect /

Configuring Active Template presented results are as follows:

webp

ok example .gif

/ 5 Summary /

In summary, a simple template configuration lose it all, here, we look at how it makes us lazy, do the web we all know, python famous web framework, Django, but when we write of view, is FBV mode (function corresponding to the url), but in practice, we are more robust for the code, usually using CBV mode (class corresponds to url), we look at whether the activity template will give us quick.

webp

cbv.gif

It is not it a little faster than before the point, do not write request, do not write args, right!

Well, today went to dry it, as to how to play active template, thanks to a small partner to play, oh!



Guess you like

Origin blog.51cto.com/13389043/2484895