演员吴军,win7,copycat表情包
import numpy as py from captcha.image import imagecaptcha import os number = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0'] def random_caption_text(char_set=number, captcha_size=4): captcha_text = [] for i in range(captcha_size): # 随机选择 c = py.random.choice(char_set) captcha_text.append(c) return captcha_text def get_captcha_text_to_image(): image = imagecaptcha() # 随机获取验证码 random_num = random_caption_text() # 把验证码转换为字符串 captcha_text = ''.join(random_num) # 生成验证码 captcha = image.generate(captcha_text) image.write(captcha_text, 'c:/users/administrator/desktop/image/captcha/' + captcha_text + '.jpg') def main(): for i in range(1000): get_captcha_text_to_image() if __name__ == '__main__': main()
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Python 实现将numpy中的nan和inf,nan替换成对应的均值
python爬虫把url链接编码成gbk2312格式过程解析
网友评论