The use of Pyyaml module in Python

I. what is YAML YAML is a special language for writing configuration files, which is far more convenient than JSON format. The design goal of YAML is to facilitate human reading and writing. YAML is a lighter file format than XML and JSON, and it's simpler and more powerful. It can express structure through indentation. Does it sound like a ...

Posted by agnalleo on Wed, 20 Nov 2019 04:46:16 -0800

Node.js Asynchronous Programming Evolution Theory

This article uses the "Signature 4.0 International (CC BY 4.0)" license agreement, and welcomes reprinting, or re-modifying the use, provided the source is indicated. Signature 4.0 International (CC BY 4.0) Node.js asynchronous programming callback We know that there are two ways to handle events in Node.js, callback and EventEmitter. ...

Posted by isedeasy on Tue, 19 Nov 2019 20:15:42 -0800

Python notes: observer mode

In the observer pattern, the subject object generally has a core service that other services depend on, and maintains a list of other objects that depend on this core service (that is, the list of observers or monitors). When the subject object changes, the observer should change his or her state or perform some operations Three roles in the o ...

Posted by fnairb on Tue, 19 Nov 2019 11:42:17 -0800

django sets cookie s and session s

1 set cookie s In this case, the application name is cookie Model model from django.db import models from django.db import models class UserInfo(models.Model): username = models.CharField(max_length=64) password = models.CharField(max_length=64) Database migration python manage.py makemigrations python manage.py migrate ...

Posted by BlueGemini on Tue, 19 Nov 2019 08:19:28 -0800

Django framework 5-cookie s and session s

Why do we have cookie s and session s? Browser sends http request to server, establishes session, server returns complete, session ends, browser and service disconnect Send the http request again and establish the session again. The user information will be lost. The server cannot distinguish the requested information. A login account. After t ...

Posted by NINTHTJ on Tue, 19 Nov 2019 07:26:37 -0800

Blueprint in Flask

Catalog 1. Overview of flask blueprint 2. A simple blueprint implementation 2.1 example 1: 2.2 example 2: 3. Blueprint to realize the addition, deletion, modification and search of student information 3.1 view student information: 3.2 student information update: 3.3 increase ...

Posted by FD_F on Mon, 18 Nov 2019 23:51:34 -0800

CBrother script 10 minutes to write a program to save "Dogbuster Server"

CBrother scripting language 10 minutes to write a program to save the "Dogbuster Server" In a new company, I took over a piece of c++ server code and leaked memory everywhere. This server has no database. Just restart it after hanging up. The company has been living for several years. Restart it regularly or every day. It may hang up ...

Posted by Daniel.Conaghan1 on Mon, 18 Nov 2019 17:46:06 -0800

Module 2: serialization module and collections module

I. serialization module json module ''' Serialization: converting data types from python or other languages to string types json module: is a serialization module. json: Is a "third party" special data format. You can use the python data type -- json data format -- string -- File To use python data in ...

Posted by richardbotw on Mon, 18 Nov 2019 01:47:32 -0800

Sword finger Offer: regular expression matching (C++/Python)

Title Description Please implement a function to match regular expressions including '.' and '*'. The character '.' in the pattern indicates any character, while '*' indicates that the character before it can appear any number of times (including 0 times) In this problem, matching means that all characters of a string match th ...

Posted by PunjabHaker on Sun, 17 Nov 2019 13:54:48 -0800

Extracting Chinese information from Chinese PDF file by python3 operation

https://github.com/pdfminer/pdfminer.six Extract files after downloading Due to the processing of Chinese files, precompiling is required To work with the CJK language, do the following before running setup.py install: mkdir pdfminer\cmap   python tools\conv_cmap.py -c B5=cp950 -c UniCNS-UTF8=utf-8 pdfminer\cmap Adobe- ...

Posted by smoked1 on Sun, 17 Nov 2019 12:57:28 -0800