Tag:python
-
Time:2021-3-4
At present, there are only three kinds of problems, such as titles, using regular expressions to match fields re.match() re.search() re.findall() For a brief introduction, re.match () and re.search () is very similar. The main difference is that the former matches from the beginning of the target string, while the latter does not. and re.findall […]
-
Time:2021-3-1
This article mainly introduces the python real-time video streaming code example, the article through the example code is very detailed, for everyone’s study or work has a certain reference learning value, need friends can refer to @action(methods=[‘GET’], detail=True) def video(self, request, pk=None): “”” Get device real time video stream :param request: :param pk: :return: “”” […]
-
Time:2021-2-26
This article mainly introduces the process analysis of RSTP video stream processing by python. The sample code is introduced in great detail, which has a certain reference learning value for everyone’s study or work. Friends in need can refer to it Python links the Haikang camera and plays the real-time video stream in the form […]
-
Time:2021-2-24
Introduction to JMeter JMeterIs a Java basedStress testing tools. It was originally designed for web application testing, but later extended to other testing areas. It can be used to test static and dynamic resources, such as static files, Java applet, CGI script, Java object, database, FTP server, etc. JMeter can be downloaded from: https://jmeter.apache.org/download_ jmeter.cgi […]
-
Time:2021-2-20
Maze problem Problem Description: Maze can be represented by square matrix [M, n], 0 means that it can pass, 1 means that it cannot pass. If the upper left corner (0, 0) is required to enter, the algorithm is designed to find a path that can go out from the lower right corner (m-1, n-1). […]
-
Time:2021-2-19
This project uses Python and OpenCV to realize the digital recognition of credit card preparation in advance Import Toolkit Define function Template image processing Read template image CV2. Imread (IMG) Gray processing CV2. Cvtcolor (IMG, CV2. Color_ BGR2GRAY) Binarization CV2. Threshold () Outline – Outline Credit card image processing Read credit card image CV2. Imread […]
-
Time:2021-2-15
Tensor to numpy np.array(Tensor) Numpy to tensor torch.Tensor(numpy.darray) PIL.Image.Image Convert to numpy np.array(PIL.Image.Image) Numpy to PIL.Image.Image Image.fromarray(numpy.ndarray) First of all, it needs to be guaranteed numpy.ndarray convert to np.uint8 type numpy.astype ( np.uint8 ), pixel value [0255]. At the same time, the gray image is guaranteed numpy.shape Is (h, w), channels cannot appear We need […]
-
Time:2021-2-12
This article mainly introduces the implementation of communication control between threads based on event in Python. The example code is introduced in great detail, which has a certain reference learning value for everyone’s study or work. Friends in need can refer to it import threading,time class Boss(threading.Thread): def run(self): print(“We must work today!”) event.isSet() or […]
-
Time:2021-2-9
This article mainly introduces the python hashlib common summary algorithm detailed explanation, the article through the example code introduction is very detailed, for everyone’s study or work has a certain reference learning value, need friends can refer to Python hashlib provides common summarization algorithms, such as MD5, SHA1 and so on Calculate the MD5 value […]
-
Time:2021-2-6
1. Single thread cracking pure digital password Note: passwords starting with the number 0 are not included import zipfile,time,sys start_time = time.time() def extract(): zfile = zipfile.ZipFile (‘ IdonKnow.zip ‘)? Read the compressed package. If necessary, add’ R ‘ for num in range(1,99999,1): try: pwd = str(num) zfile.extractall(path=’.’,pwd=pwd.encode(‘utf-8’)) Print (“current compression password is, PWD) end_time […]
-
Time:2021-2-5
This article mainly introduces how Python to read the image format in the file. The sample code is introduced in great detail, which has a certain reference learning value for everyone’s study or work. Friends in need can refer to it Under normal circumstances, the suffix of image naming is the same as the format […]
-
Time:2021-2-3
Memory leak when Python runs a loop Today, when testing regression with tensorflow, you just need to cycleMore than 4000 times(to add, I ran on a personal PC). After running, I went to eat. When I get back, the console window will open directlyBright redThank you!!! import numpy as np import pandas as pd import […]