[Technology] How do I chase the goddess with three lines of code

[Technology] How do I chase the goddess with three lines of code
(The content of this article is purely fictitious, please do not substitute)

“明天我们的女神生日了,不知道在心里表白了多少次,但仅仅是在心里面。

[Technology] How do I chase the goddess with three lines of code

“这可是女神在大学时期的最后一次生日了,我已经在心里打定了主意,一定要在这一天向女神表白,否则大学就毕业了。

[Technology] How do I chase the goddess with three lines of code

"As a farm yard, take advantage of this opportunity to declare, should make showing off my expertise. So I said I intend to write in the words of the goddess in a two-dimensional code, look for opportunities to show out on it!
[Technology] How do I chase the goddess with three lines of code
To achieve This function only needs 3 lines of code!


import qrcode
img = qrcode.makr("your text here!")
img.save("qrcode.jpg")
“就只需要这3行,就可以生成了一个专属的二维码。
当然,如果你还没安装qrcode库,记得pip install qrcode一下
现在万事俱备,接下来就只需要把下面的二维码打印出来,放在女神的生日礼物上就行了,女神就能看到我对她说的心里话了!

[Technology] How do I chase the goddess with three lines of code

“哎呀,贴错了。不过如果你已经扫进去了,就帮忙关注一下我的公众号吧,嘻嘻嘻~!

"The following should be posted:
[Technology] How do I chase the goddess with three lines of code

“当然,这篇文章其实是想介绍怎么用python生成qrcode
老K生活中并没有什么女神。如果您因为标题中的“女神”而被骗进来的话,老K表示十分抱歉。
“不过python生成qrcode这个功能除了生成网页链接,还是可以在很多场景中使用的,开启你的想象吧!
“对代码感兴趣的小伙伴,到老K玩代码公众号,发送python入门书获取免费学习资料吧~

Guess you like

Origin blog.51cto.com/15069443/2576244