码迷,mamicode.com
首页 > 其他好文 > 详细

svg_png

时间:2017-04-21 20:42:32      阅读:230      评论:0      收藏:0      [点我收藏+]

标签:account   numbers   env   odi   strip   strip()   utf-8   inpu   str   

#!/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

标签:account   numbers   env   odi   strip   strip()   utf-8   inpu   str   

原文地址:http://www.cnblogs.com/xiaojikuaipao/p/6745058.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!