Make your own QQ/WeChat QR code with one line of code, and you can also make dynamic ones~ (Xiaobai doesn’t have to ask others anymore)

Today, we are going to use Python to make a cool QR code, which can be moved

Stop talking nonsense, let's start making it~

Install MyQR

1. Clickwin+rTo enter the running page:
Insert picture description here
2. Entercmd, Clickdetermine:
Insert picture description here
3. Open the page and enter 'pip install myqr -i https://pypi.tuna.tsinghua.edu.cn/simple'You can download myqr at high speed

Insert picture description here

To achieve permanent high-speed download, please see: How to achieve high-speed download with python pip

CMD generates image QR code

First of all, we have to prepare a picture. Here I took a picture of SpongeBob Squarepants and placed it on the desktop:
Insert picture description here
imy.jpg

Then:
1. Open cmd according to the above method
2. Enter the following code in cmd:

myqr -c -v20 -p 你的图片名(必须在桌面上) 链接

Such as myqr -c -v20 -p imy.jpg https://blog.csdn.net/CSDN_C2
3. View the generated QR code:

Insert picture description here
Isn’t it cool?

Use Python to generate (look at friends who failed to generate)

Let us first look at the parameter table:
Insert picture description here

In fact, it is very simple, two lines of code:

from MyQR import myqr
myqr.run(words=链接,version=20,level='H',picture=图片路径,colorized=True,save_dir=图片所在位置)

python 注:路径中的’\‘要写成'\\';picture=图片路径中的’图片路径‘要加图片本身,如'C:\\Users\\Administrator\\Desktop\\imy.jpg',save_dir=图片所在位置中的'图片所在位置'不要加图片本身,如'C:\\Users\\Administrator\\Desktop\\'

such as:

from MyQR import myqr
 
myqr.run(words='https://blog.csdn.net/CSDN_C2',version=20,level='H',picture='C:\\Users\\Administrator\\Desktop\\imy.jpg',colorized=True,save_dir='C:\\Users\\Administrator\\Desktop\\')

Check out the results!

Make an animated QR code & black and white QR code

1. Make a two-dimensional code for moving pictures
Here, I prepared a moving picture, which has been placed on the desktop:
Insert picture description here
Then, we only need to change the file path. After you press Enter, you can start a black game, because a GIF consists of hundreds or thousands of GIFs, and the resolution is about n times that of a jpg picture (in fact, it is not so exaggerated, generally GIF emoticons For dozens of frames)

Huhu, after waiting for more than ten minutes, I finally completed the 13.63MB picture (because I couldn't upload it, I could only cut it down). It looks like this:
Insert picture description here

2. Make a black and white QR code,
just change the colorized parameter to False

from MyQR import myqr
myqr.run(words=链接,version=20,level='H',picture=图片路径,colorized=是否为彩色,save_dir=图片所在位置)

We use imy.jpg again as an example. Insert picture description here
Results:
Insert picture description here

Actual combat: Make your own QQ/WeChat QR code

Some friends may ask: Why did I make my own QQ/WeChat QR code, even though it was written according to the above, it still cannot be scanned? You may only use QQ\WeChat ID to replace the link, and the phone will be confused: what does the number here mean? Is it a phone number? A QQ number? A game number? So he would never understand his meaning. So we should convert it into a link, and you will get to that interface after scanning.
1. Save our QQ/WeChat plus friends QR code, payment code and other QR codes to the computer

2. Then we have to enter https://cli.im/deqr/ in the browser
Insert picture description here

3. After entering, drag the QR code up
Insert picture description here
4. Get the decoding
Insert picture description here
5. Enter the command:

Note:
1. If there is an & in the decoding link, enter quotation marks to wrap the & in the cmd.
2. If it cannot be scanned, please zoom out the lens
. 3. Do not have any obstructions on the QR code, otherwise it will not be scanned come out

If you have any questions, please discuss in the comment section

Hope this article can be of some help to you

END

Guess you like

Origin blog.csdn.net/CSDN_C2/article/details/108257398