python
文章平均质量分 50
m0_38141582
这个作者很懒,什么都没留下…
展开
-
python爬取图片
import urllib.request import re def getHtml(url): page = urllib.request.urlopen(url) html = page.read() return html def getImg(html): html=html.decode('utf-8')原创 2017-09-23 10:56:52 · 319 阅读 · 0 评论 -
python统计代码空行与注释
#_*_coding:utf-8_*_ # 统计代码行数, 空行, 注释. import os def code_lines_count(path): code_lines = 0 comm_lines = 0 space_lines = 0 for root,dirs,files in os.walk(path):转载 2017-09-18 10:27:39 · 590 阅读 · 0 评论 -
python生成随机图片验证码
from PIL import Image,ImageDraw,ImageFont,ImageFilter import random import string chars=string.digits+string.ascii_letters chars=random.sample(chars,4) print(chars) def rndColor(): #产生随机颜色原创 2017-09-19 11:19:26 · 1960 阅读 · 0 评论