简体   繁体   English

如何使用Python中的“ QR工具”以QR码存储多种数据格式

[英]How do i store multiple data format in a QR code using “QR-tools” in python

qrtools documentation qrtools文档

for example: 例如:

from qrtools import QR

#url
my_QR = QR(data = u"https://www.poemhunter.com/", 
                  data_type = 'url',pixel_size = 10)

I want to store 2 data type ie(Email and url) both in one QR code) 我想在一个QR码中存储2种数据类型,即(电子邮件和URL)

#email
#my_QR = QR(data = u"abcde@gmail.com.com",data_type = 'email',pixel_size = 10)

#encodes to a QR code
my_QR.encode()

vCard is format to store contact information. vCard是用于存储联系信息的格式。 You can use it if you want to share the content of a visit card just with one QR Code. 如果您只想与一个QR码共享访问卡的内容,则可以使用它。

In your example, if you want to share an email address and a website, you can put this text as data in your QR Code: 在您的示例中,如果您想共享一个电子邮件地址和一个网站,则可以将此文本作为数据放入QR码中:

BEGIN:VCARD
VERSION:2.1
N:;
FN: 
ORG:
TITLE:
ADR:;;;;;;
TEL;WORK;VOICE:
EMAIL;PREF;INTERNET:john@doe.com
URL:http://john.doe.com
NOTE:
END:VCARD

As you can see, there are some missing values (I'm not sure if all the data are compulsory). 如您所见,有一些缺失值(我不确定是否所有数据都是强制性的)。 You can also add the name, address, phone number, ... 您还可以添加姓名,地址,电话号码,...

I think its the best way to store multiple data format in one QR Code. 我认为这是在一个QR码中存储多种数据格式的最佳方法。 You can find here an example to create a QR Code who contains a vCard with QRtools. 您可以在此处找到创建QR码的示例,其中包含带有QRtools的vCard。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM