[Huawei cloud technology sharing] beginner's part, know the most common and important library Requests of Python
Requests library is the most important and common library in Python crawler. You must master it skillfully
Let's meet this library
Requests library is the most important and common library in Python crawler. You must master it skillfully
Let's meet this library
import requests
url = 'http://www.b ...
Posted by Karl33to on Mon, 17 Feb 2020 02:19:34 -0800
Multi-threaded and multi-process detail
I. Threads
What is a thread?
The basic unit of CPU scheduling and allocation. When the current thread CPU time slice is exhausted, it will cause the next operating system scheduling, such as CPU, to execute when it is its turn.The operating system does not allocate memory for threads, but groups of ...
Posted by sgarcia on Sun, 16 Feb 2020 17:43:28 -0800
HashSet and list performance
Obviously, the search performance of the general HashSet < T > class is higher than that of the general list < T > class. Just compare the hash based key with the linear method in the list < T > class.
However, it may take some CPU cycles to calculate the hash key itself, so for a small number of items, linear search can r ...
Posted by Cagez on Sat, 15 Feb 2020 02:03:50 -0800
Based on Python POC framework
0. Preface
Because the epidemic is busy with other things for a long time, I don't want to see a more complete poc framework and principles here to share with you to learn and discuss.
1. The frame code is as follows
#!/usr/bin/env python
#coding:utf-8
import requests
class misiinfo(object):
...
Posted by john_zakaria on Sat, 15 Feb 2020 00:11:54 -0800
Win32 process communication -- the use of mail slot
Post slot
Mail slot is a one-way interprocess communication mechanism provided by Windows operating system, which can be used in single machine or multi machine distributed environment on network. For relatively short low-frequency messages, it is usually easier to use a mail slot than a named pipe o ...
Posted by supergrover1981 on Fri, 14 Feb 2020 05:56:33 -0800
Qt+vtk configuration property sheet
At first, when using Qt to display point cloud, every time a new project is created, the directory must be configured, which is very troublesome. Recently, I suddenly realized that I can create a new property sheet, and every time I refer to the property sheet, it's OK. It taught us to be flexible.
1. ...
Posted by Kingskin on Thu, 13 Feb 2020 22:46:35 -0800
Image capture of Python crawler
I. Introduction
I've been learning Python for a long time. I've heard that Python crawlers are so powerful before. I've just learned here. I wrote a crawler program with the python video of little turtle, which can download simple web pictures.
Two, code
__author__ = "JentZhang"
import urllib.request
import os
import random
import re
def ur ...
Posted by Danestar on Thu, 13 Feb 2020 08:09:34 -0800
Python 3 reptile battle data of pneumonia
Reptile thinking
The first step is to get the data we need
Tencent, Netease, clove doctor and other platforms have real-time data of the epidemic. After crawling the data of each platform, it is found that the data returned by Dr. lilac is static. If you want to crawl in Tencent and Netease, you nee ...
Posted by wmac on Thu, 13 Feb 2020 01:39:22 -0800
Array of C ා basis
Array of C ා basis
This paper introduces the array in C ා language, and realizes the program of prime number (bool array) and block game (button array) by the array.
I. array
1. Array overview
An array is a combination of data of the same type
Array belongs to reference type
How to declare a one- ...
Posted by dwu on Wed, 12 Feb 2020 07:04:24 -0800
PAT A1017 Queueing at Bank (25point(s))
Suppose a bank has K windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. All the customers have to wait in line behind the yellow line, until it is his/her turn to be served and there is a window available. It is assumed that no window ...
Posted by hstraf on Wed, 12 Feb 2020 01:26:46 -0800