stay Python To generate a two-dimensional code, you need to call MYQR Third party Library , This library can be said to be specially tailored for two-dimensional code , Call the run Function can directly generate the desired two-dimensional code ,
.
Ordinary QR code
========================================================================
To generate a normal QR code, you only need to run Middle feeding words The QR code to be generated can be passed in , For example, we will 360 The browser's main interface generates a QR code : The website is :“https://hao.360.com/”.
Run the following code :
from MyQR import myqr
myqr.run(words='https://hao.360.com/')
Be accomplished , At this time, we can find the generated in the default folder of the program .png Format of the QR code .
.
Art QR code with pictures
============================================================================
When generating art QR code with pictures , We need to add... To the original program picture Parameters , The background image of the QR code we want to set , Use colorized=True Parameter setting picture background color , If you don't set , The default image is black and white background .
We can also use save_name Parameter name the QR code .
It is worth noting that : To avoid image format errors , The format of the named QR code needs to be the same as that of the background image .
For example, we use pictures “mtsc_body15.png” Generate a QR code for the background . The generated QR code is named “qr1.png”
The code is as follows :
from MyQR import myqr
myqr.run(words='https://hao.360.com/',
picture='Sources/mtsc_body15.png',
save_name='qr1.png',
colorized=True)
The effect of the generated QR code is as follows :
.
Dynamic QR code
========================================================================
In fact, dynamic two-dimensional code is similar to art two-dimensional code with pictures , We just need to change the background image to GIF chart , Change the format of the generated QR code image to GIF that will do . Dressed in beautiful new clothes GIF Here's an example :
The code is as follows :
from MyQR import myqr
myqr.run(words='https://hao.360.com/',
picture='Sources/gakki.gif',
save_name='qr4.gif',
colorized=True)
In fact, about Kafka, There are too many questions to ask , Grilled for a few days , In the end 44 ask : The basic chapter 17 ask 、 Advanced 15 ask 、 Advanced 12 ask , All stabbing pain points , I don't know if you don't worry about the answer , How many can you answer ?
If yes Kafka I can't recall my knowledge , Let's first look at my hand drawn knowledge summary brain map (xmind Can't upload , The article uses a picture version ) Sort out the overall architecture
Data collection method : Click here to download for free
Sort out the knowledge , After the interview , If you want to further study and interpret kafka And source code , So the next one 《 Handwriting “kafka”》 Would be a good choice .
Kafka introduction
Why choose Kafka
Kafka Installation 、 Management and configuration
Kafka The cluster of
first Kafka Program
Kafka The producers of
Kafka The consumer
In depth understanding of Kafka
Reliable data transmission
Spring and Kafka Integration of
SpringBoot and Kafka Integration of
Kafka The practice of cutting peaks and filling valleys
Data pipeline and streaming ( Understanding can )
consumer
In depth understanding of Kafka
Reliable data transmission
Spring and Kafka Integration of
SpringBoot and Kafka Integration of
Kafka The practice of cutting peaks and filling valleys
Data pipeline and streaming ( Understanding can )
[ Outside the chain picture transfer in …(img-eS8xiDYC-1628508779173)]