首页 > 编程语言 >python: qrcode

python: qrcode

时间:2022-12-17 13:11:08浏览次数:50  
标签:scale python segno install qrcode geovindu com

python.exe -m pip install --upgrade pip

pip install segno
pip install qrcode
pip install qrcode-artistic
pip install urlopen
pip install Image
pip install ImageDraw
pip install ImageSequence
pip install consts


https://github.com/heuer/segno/ Python QR Code and Micro QR Code encoder
https://github.com/lincolnloop/python-qrcode Python QR Code image generator
https://github.com/heuer/qrcode-artistic
https://segno.readthedocs.io/en/latest/qrcode-modes.html
https://segno.readthedocs.io/en/latest/artistic-qrcodes.html

 

import segno;
# import qrcode;
# import qrcode_artistic;
import io;
from urllib.request import urlopen;



if __name__ == '__main__':

     print('hellow geovindu');
     # draw 
     video = segno.make('http://www.dusystem.com');
     video.save('geovindu.png', scale = 4);
     geovindu = segno.make('http://www.dusystem.com', error='h');
     #添加底版图片,也可以添加GIF动态图片 涂聚文,geovindu,Geovin Du
     geovindu.to_artistic(background='1.png', target='geovindu2.png', scale=16);
     url = 'https://media.giphy.com/media/HNo1tVKdFaoco/giphy.gif';
     bg_file = urlopen(url);
     geovindu.to_artistic(background=bg_file, target='ringo.gif', scale=10)

     # 转方向
     img = geovindu.to_pil(scale=3).rotate(45, expand=True)
     img.save('yellow-geovindu-rotated.png')
     # 底色
     img2 = geovindu.to_pil(scale=4, dark='darkred', data_dark='darkorange',data_light='yellow');
     img2.save('yellow-geovindu-submarin.png')
     
     # 动态的二维码
     url2 = 'https://media.giphy.com/media/mUPQmck5YEisg/giphy.gif';
     bg_file2 = urlopen(url2);
     out = io.BytesIO();
     geovindu.to_artistic(background=bg_file2, target=out, scale=5, kind='gif')

  Visual Studio 2022

 

 

 

 

PyCharm 2021.2.3

 

 

 

 

标签:scale,python,segno,install,qrcode,geovindu,com
From: https://www.cnblogs.com/geovindu/p/16988854.html

相关文章