首页 > 代码库 > svg_png

svg_png

#!/usr/bin/env python
#-*- encoding=UTF-8 -*-
from __future__ import print_function
import sys
import random
import string
import os
random.seed(1)
letters = string.ascii_letters
numbers = ‘‘.join([str(i) for i in range(10)])
seed = letters + numbers

sudo apt-get install python-cairosvg

 sudo pip install cairosvg


for i in range(1,101):
passwd = ‘‘.join(random.sample(seed,18))
passwd = passwd + str(i)
print(passwd)

 

 

 

#!/usr/bin/env python
#-*- encoding=UTF-8 -*-
from __future__ import print_function
import click


@click.command()
@click.argument("inputlist")
@click.argument("svgfile")

def account_generate(inputlist,svgfile):
svgt = ""
with open(svgfile) as s1:
for s in s1:
svgt += s
i = 0
with open(inputlist) as fin:
for line in fin:
i = i+1
c1 = line.strip()
svgp = open("GFK_vip"+str(i)+".svg","w")
svgtt = svgt.replace("account",c1)
svgp.write(svgtt)
svgp.close()

 

if __name__ == ‘__main__‘:
account_generate()

svg_png