Python uses PyYAML library to read and write yaml configuration files

I. yaml file introduction yaml is a special language for writing configuration files. 1. yaml file rules Case sensitive; Use indents to represent hierarchical relationships; Indent with spacebar instead of Tab The number of indented spaces is not fixed, only the left side of elements of the same level needs to be aligned; The strin ...

Posted by slevytam on Thu, 21 Nov 2019 05:51:53 -0800

Python Basics - functions

A function, also known as a method, is a piece of code used to implement a specific functionFunction to improve code reusabilityFunction must be called to executeThe variables defined in the function are local variables. Local variables can only be used in the function and cannot be used outside the functionA function does only one thing import ...

Posted by Riparian on Wed, 20 Nov 2019 07:27:11 -0800

WebApi data validation - model state validation returns all error information, and returns common result classes uniformly,

I. public return class (defined according to the needs of the project, consistent with the normal request data return result class) Note: please expand the generic return class yourself. This article is only an example and only lists one non generic return class. EnumAppCode is an enumeration of error codes. Please define it yourself. usin ...

Posted by tron00 on Wed, 20 Nov 2019 07:03:14 -0800

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

Common encryption methods in java

First, import the jar package, commons-codec.jar. You can use maven or go to the maven official website to download the jar https://mvnrepository.com/artifact/commons-codec/commons-codec/1.12 <dependency> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> <version ...

Posted by candy2126 on Tue, 19 Nov 2019 09:54:28 -0800

Android learning notes

The button changes the background as you press: First write a selector.xml: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <!-- Specify picture when pressed--> ...

Posted by 22Pixels on Mon, 18 Nov 2019 11:22:49 -0800

Spring Cloud Alibaba Sidecar multilingual microservices heterogeneous

Introduction to Spring Cloud Alibaba Sidecar Since spring cloud Alibaba version 2.1.1, the spring cloud Alibaba sidecar module has been added as a proxy service to indirectly let other languages use spring cloud Alibaba and other related components. Through the route mapping with the gateway, the service can be obtained, and then the Ribbon can ...

Posted by ngubie on Mon, 18 Nov 2019 11:22:19 -0800

Python data interpretation of the most popular bread in Jingdong

Preface   What's the best brand of bread to sell? What is the most popular taste? I believe that every friend who likes bread will care about these problems. By crawling the bread data of Jingdong, on the one hand, this paper answers all kinds of questions about bread before, on the other hand, it brings you a complete data r ...

Posted by mechamecha on Mon, 18 Nov 2019 11:01:58 -0800

Applet deployment

First of all, wechat users need to log in automatically to check the session. If the session expires, log in again wx.checkSession({ success: function (res) { }, fail: function (res) { console.log("Need to sign in again"); wx.login({ success(res) { if (res.code) { ...

Posted by longhorn14 on Mon, 18 Nov 2019 08:38:32 -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