Python3 Standard Library: Multprocessing manages processes like threads

1. Multprocessing manages processes like threads The multiprocessing module contains an API that is based on the threading API and divides work into multiple processes.In some cases, multiprocessing can replace threading as a temporary replacement to utilize multiple CPU cores, thereby avoiding computing bottlenecks caused by Python global inte ...

Posted by laurton on Mon, 30 Mar 2020 18:55:34 -0700

vnpy source reading learning: about app

About app In the entry program, we see gateways, apps, and various types of engines added to mainEngine.It is not difficult to guess that gateway mainly deals with external situations, interface code in all aspects, and it is not difficult to see that Engine is the core of vnpy through other people's articles, and can handle all aspects such as ...

Posted by _spaz on Sun, 29 Mar 2020 21:24:55 -0700

Python3 Standard Library: Managing concurrent operations in threading processes

1. Manage concurrent operations in threading processes The threading module provides an API to manage the execution of multiple threads, allowing programs to run multiple operations concurrently in the same process space. 1.1 Thread object The easiest way to use Thread is to instantiate a Thread object with a target function and call start() to ...

Posted by j.smith1981 on Sun, 29 Mar 2020 18:54:15 -0700

Python learning - shopping cart program

Procedure: shopping cart procedure Demand: After starting the program, let the user enter the salary, and then print the list of products Allow users to purchase products according to the product number After the user selects the goods, check whether the balance is enough, deduct the money directly if it is enough, and remind if it is not enou ...

Posted by timbuckthree on Sun, 29 Mar 2020 08:45:56 -0700

Basic technology of machine vision implemented by python+opencv (edge extraction, image filtering, edge detection operator, projection, license plate character segmentation)

Catalog 1: Edge extraction 1. Threshold segmentation and color reversal of image 2. Edge extraction 2: Image filtering 1. Read the original drawing 2. Mean filtering 3. Median filtering 4. Gaussian filtering 5. Gaussian edge detection 3: Edge detection operator 1. Display the original drawing 2. Reverse the image 3. Image edge detec ...

Posted by kliopa10 on Sun, 29 Mar 2020 05:47:54 -0700

OpenCV-Python uses OCR handwriting data set to run SVM | fifty-six

target In this chapter, we will recognize the handwritten dataset again, but use SVM instead of kNN. Recognize handwritten numbers In kNN, we directly use pixel intensity as feature vector. This time we will use the directional gradient histogram (HOG) as the feature vector. Here, we use the second-order moment to correct the skew of the image ...

Posted by gurjit on Sun, 29 Mar 2020 00:05:02 -0700

Simple mahjong ai algorithm

Simple mahjong ai algorithm Write a mahjong game, need to automatically play ai algorithm, do it yourself, although not very smart, but surprised by its simplicity, just record it. Implemented in python. First, summarize the rules of mahjong. The seemingly complex rules of mahjong can be expressed by a formula. Hu = AA and (AAA or AAAA or ABC) ...

Posted by daneilair on Sat, 28 Mar 2020 10:11:27 -0700

How to use python crawler to crawl from a chapter novel to a whole station novel

  Preface The text and pictures of the article are from the Internet, only for learning and communication, and do not have any commercial use. The copyright belongs to the original author. If you have any questions, please contact us in time for handling. PS: if you need Python learning materials, you can click the link below to get http://t. ...

Posted by rinventive on Sat, 28 Mar 2020 08:08:42 -0700

Python 3 standard library: zlib GNUzlib compression

1. zlib GNUzlib compression Zlib module provides the underlying interface for many functions in the zlib compression library of GNU Project. 1.1 processing data in memory The simplest way to use zlib requires that all data to be compressed or decompressed be stored in memory. import zlib import binascii original_data = b'This is the original ...

Posted by zippers24 on Fri, 27 Mar 2020 10:20:54 -0700

sublime shortcut keys and settings configuration - jetbrains habits

start After many small partners use jetbrains series editors and use lightweight sublime, some settings and shortcut habits may not be suitable Today, Xiaobian will give you some common sublime settings and shortcut key configurations Set up { // Color theme "color_scheme": "Packages/Color Scheme - Default/Monokai.sublime-color-scheme", ...

Posted by hunna03 on Fri, 27 Mar 2020 09:17:59 -0700