Python generates two-dimensional code that can be used with the QRCode module, GitHub address
I'm a porter.
Install it first, because it is ready to be generated and then displayed, so use the Pillow module
InstallInstall Pillow
Before writing the code, initialize a picture file,
" anything " > Test.png
Now this test.png is already a QR code, and the content after the scan is the "anything" string that was written when it was initialized.
We can use the QRCode module to modify this content.
from Import ImageIn [import Qrcodein [3]: img = qrcode.make ('Hello,you' ) ) in [4]: Img.save ('test.png') # Modifies the contents of the QR code and saves it to a file in [5]: img = image.op En ('test.png') in [6]: Img.show () # Show pictures
Just a brief introduction, please refer to the GitHub documentation for advanced usage
Generate two-dimensional code with Python