Python create two-dimensional code address Book

Source: Internet
Author: User

Reference Documentation:

Python QR code generation Library QRCode installation and use example:

vcard Format Parameters detailed description:

QR code generation tool: Http://

Preparation environment:

System version: CentOS release 6.5

Installing Pip:yum Install Python-pip

Installing QRCODE:PIP Install QRCode

Installation official website download package:

Install PIL: Download package: wget

To create a directory:

Project directory:/root/erweima

The entire directory structure is as follows,

[Email protected] erweima]# tree
















Code writing:

List part of the code

[email protected] erweima]# cat


Import Web

Import QRCode

Import time

From PIL import Image

URLs = (

'/', ' Index '


Render = Web.template.render (' templates ')

def Code (info):


Return Imgpath

Class Index (object):

def GET (self):

Return Render.index ()

def POST (self):

info = Web.input ()

Print Info

return Code (Info)

if __name__ = = ' __main__ ':

Web.application (Urls,globals ()). Run ()


Launch, page generation QR code

Use the account sweep code, inside is an address book, can save to phone address book. (QQ can also be swept)

Python create two-dimensional code address Book

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: 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.