"PYTHON" two-dimensional code generation

Source: Internet
Author: User

What is the QR code?

Two-dimensional code from one-dimensional code extension, adding another dimension of readable barcode, with black and white rectangular graphic representation of binary data, the device is scanned after the information contained therein, two-dimensional code length, width are recorded data, QR code has a positioning point and fault-tolerant mechanism, even if not all the barcode identification, The barcode information can also be correctly restored according to the fault tolerance mechanism.

My blog QR code: The most common two-dimensional code

How to identify the direction of QR code? Can you identify your phone's horizontal and vertical rows?

In the case of QR code, there are three large positioning points that can be identified in any direction.

What information can the QR code record?

Network connection, text, picture.

What are the applications of QR codes?

, train tickets, ubiquitous merchant advertising links, etc.

QR Code supplemental knowledge, from Wikipedia

A friend scan with a QR code scanning device

Python has a very convenient two-dimensional code generation library: QRCode, can only generate two-dimensional code, can not decode.

ImportQRCode
qr = QRCode. QRCode (
Version=1,
Error_correction=qrcode. error_correct_l,
BOX_SIZE=10,
Border=4,
)
Qr.add_data (R'http://www.cnblogs.com/learn-my-life/')
Qr.make (Fit=true)
img = Qr.make_image ()
Img.save ('D:\\test.png')

Precautions

QRCode is a third-party library, and QRCode relies on the PIL library.

The build process is likely to be guessed from the function name.

"PYTHON" two-dimensional code generation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.