GitHub,csdn,wordpress,stackoverflow…….. 这么多站点,每次要设置头像真是件令人头疼的事呢。~ so,利用pagan库生成每个网站对应的头像,不用再每次都愁用什么照片啦。
1. 安装pagan库
Way1:
pip install pagan
Way2:
git clone https://github.com/daboth/pagan.git
python setup.py install
2.
# coding: utf-8
import pagan
#修改为对应网站
inpt = 'csdn'
img = pagan.Avatar(inpt, pagan.SHA512)
img.show()
outpath = 'output/'
filename = inpt
img.save(outpath, filename)
img.change('new input', pagan.SHA256)