Analysis of hot words by using word cloud diagram

1. Install the third-party library (matplotlib, jieba, wordcloud, numpy) 1.1 installation method: online installation of pip command (pip is installed by default in python3.x, and the download address of pip is: https://pypi.python.org/pypi/pip#downloads) If the environment variables have been configured, run directly in the cmd window: pip ins ...

Posted on Fri, 06 Dec 2019 07:12:21 -0800 by Cragsterboy

Python calls the zabbix api

Prerequisite preparation: 1. Use python requests module 2. Learn about json 3. The specific call of ZABBIX API is recommended to browse the official website first First code: import requests,json # #The url must be correct. Change the IP address to the one of your own zabbix server zbx_url = "http://192.168.60.130:3080/zabbix/api_jsonrpc.php" ...

Posted on Fri, 06 Dec 2019 05:22:43 -0800 by harvey

JWT learning summary

The full name of JWT is JSON web tokens, which is a set of specifications to deal with Http's stateless and plaintext transfer request, to ensure the security of the request. We usually use it to transfer the user's identity information between the server and the client to maintain the state. 1. What are its advantages over the common session+c ...

Posted on Fri, 06 Dec 2019 05:03:21 -0800 by garek007

Django advanced auth integrated authentication module

auth authentication module is a user authentication module integrated in Django. auth authentication module method Method Interpretation auth.authenticate() Authentication verification auth.login(request,user) Encapsulate the authenticated user object auth.logout(request) Delete all session data and the cookie is invalid Example of ...

Posted on Fri, 06 Dec 2019 02:16:43 -0800 by PHP_PhREEEk

Python metaclasses and enumeration classes

Category 1 1. The type() function can return the type of the object or create a new type. It can change the behavior of class creation and realize dynamic class creation. # First parameter: class name # Second parameter: ancestor of parent class # The third parameter: property, method A = type("A",(object,),{"name":"zhou"}) a = A() print(type(A ...

Posted on Thu, 05 Dec 2019 19:36:14 -0800 by zenon

Python 3 basic function instance learning

Built-in function Absolute value function x = abs(100) y = abs(-20) print('x=100 The absolute value of is:{}'.format(x)) print('y=-20 The absolute value of is:{}'.format(y)) The absolute value of x=100 is: 100 The absolute value of y=-20 is: 20 Maximum, minimum, sum function print("(1, 2, 3, 4)Largest in China max The elements of are:{}".forma ...

Posted on Thu, 05 Dec 2019 18:30:59 -0800 by callmecheez

Python automatic operation and maintenance development -- basic string

1. String (string is also a kind of list) Definition: single quotation mark, double quotation mark, three single quotation marks or three double quotation marks Access method of string: access string according to index number: String is also a kind of list Definition: single quotation mark, double quotation mark, three single quotation marks o ...

Posted on Thu, 05 Dec 2019 17:56:24 -0800 by mamuni

python functions reduce, filter

## reduce >>> reduce(lambda x,y: x+y,[1,2,3,4,5]) 15 Please watch carefully. Can you see how it works? Draw a picture: Remember how map works? Forgot? Look at the code: >>> list1 = [1,2,3,4,5,6,7,8,9] >>> list2 = [9,8,7,6,5,4,3,2,1] >>> map(lambda x,y: x+y, list1,list2) [10, 10, 10, 10, 10, 10, 10, 10, 10] ...

Posted on Thu, 05 Dec 2019 17:49:19 -0800 by MMeticulous

Monitor mode of Python design mode

monitor mode Also known as observer mode, publish / subscribe mode and source listener mode, the core of the mode is to distinguish who is observed and who is observer during design. The observer has at least three ways to add observers, delete observers, monitor changes in targets, and notify observers; observers at least include one method, w ...

Posted on Thu, 05 Dec 2019 17:03:09 -0800 by joenjeru

ansible easy installation

1. Installation background In order to meet the mass and unified management of hosts and realize efficient operation and maintenance work, a large base of hosts is adopted, which adopts ansibel open source software   2. Installation environment Os Centos7.4 Python 3.6 Ansible 2.7 Python installation depends on gcc openssl Ansible dep ...

Posted on Thu, 05 Dec 2019 09:26:39 -0800 by Blackwind