❤️ Python object-oriented Teaching ❤️, Novice quick elite road!

preface Recently, when I was answering questions in the group, I often encountered errors in the use of variables, indents, parameters and other aspects, resulting in the failure of the program. Today, I'm going to write an article by myself. Python variable scope, and lifecycle. Thoroughly understand how variables should be used. Knowledge ...

Posted by mysterbx on Mon, 27 Sep 2021 13:48:49 +0200

Python program development -- Chapter 4 dictionary and collection

1, Dictionary Dictionary is a kind of mapping type, that is, key value combination. The elements in the dictionary are unordered. Keys can be strings, numbers or tuples, but lists cannot be used. (1) Dictionary creation Create a dictionary by using curly braces, or {}, which can contain multiple key value pairs (key value), with colon: ...

Posted by YAOMK on Sun, 26 Sep 2021 09:51:32 +0200

C++ Review Notes: Classes and Objects

c++ online compilation tool for fast experimentation: https://www.dooccn.com/cpp/ 1.Write before During this period of time, I plan to pick up c++. One of the lessons I learned from my internship is that Algorithm Engineers solve practical problems, so they can't be limited by algorithms or projects. They should always improve their ability t ...

Posted by idweb on Sat, 25 Sep 2021 18:13:49 +0200

AttributeError: Can't get attribute 'xxx' on <module '__main__' from 'xxx'

AttributeError: Can't get attribute 'xxx' on < module 'main' from 'xxx' another possible solution Problem Restatement: when learning pytorch, I learned to serialize the Word2Seq class using the pickle module and save the serialization in the ws.pkl file. Then I created the lib.py file again. This problem occurs when I deserialize ws.pkl wit ...

Posted by RyanJones on Sat, 25 Sep 2021 11:51:34 +0200

1015 theory of virtue and talent (25 points) python code timeout, ideas can be used for reference, very easy to understand

Sima Guang, a historian of the Song Dynasty, wrote a famous "theory of virtue and talent" in Zizhi Tongjian: "therefore, the perfection of talent and morality is called a saint, the death of talent and morality is called a fool, the victory of virtue is called a gentleman, and the victory of virtue is called a villain. If a gentl ...

Posted by nobodyk on Sat, 25 Sep 2021 11:11:11 +0200

Python Crawler Self-Study Notes Scrapy Framework

Python has many useful frameworks, and the Scrapy framework is the most important one in the crawling world. 1. Installation and Startup Installation (Command Line) pip3 install scrapy Create a scrapy project (command line goes to the directory where the scrapy project is to be created): scrapy startproject Project Name Create a crawle ...

Posted by scheols on Fri, 24 Sep 2021 20:11:25 +0200

Summary of sorting algorithm (including one-dimensional array, two-dimensional array and three-dimensional array) -- dig pits and not fill them

Reminder: 1. The pictures taken in this article are from books: Algorithm book for everyone [Japan] written by Shanpu Xian; Jueyun translation 2. The default sorting algorithm in this paper is ascending Sorting algorithm summary: 1. Bucket sorting 2. Selection sorting 3. Bubble sorting 4. Insertion sorting 5. Merge sorting 6. Hill sorting 7. Q ...

Posted by jursten on Fri, 24 Sep 2021 16:24:34 +0200

How to build a test framework from 0_ 11 - socket interface test

During interface testing, in addition to the common http interface, there is another common one, socket interface. Today, I will explain how to test socket interface with Python's own socket library. 1, socket interface Socket, also known as socket, can be understood as the address of an application and the key to network communication. We ca ...

Posted by SP8600 on Fri, 24 Sep 2021 13:23:19 +0200

"If someone had told me this“

"If someone had told me this“ brief introduction The dialogue still comes from yesterday's party with Ban Ban. At that time, we discussed the topic of higher education and subject selection , she told me that she told us %20 The dialogue was still based on yesterday's meeting with class.% 20 at that time, we discussed the topic ...

Posted by Fingers68 on Thu, 23 Sep 2021 02:53:19 +0200

OpenCV template matching

Introduction to the concept of template matching The principle of template matching and convolution is very similar. The template slides from the origin on the original image to calculate the difference between the template and (where the image is covered by the template). There are six calculation methods for this difference in opencv, an ...

Posted by Amman-DJ on Wed, 22 Sep 2021 19:38:36 +0200