Reportlab是用python开发的生成pdf的工具包,它是一个开源软件。 #!/usr/bin/env python import os import sys from re…
import math L1=['104','32','249','177'] L2=['191','538','317','795'] L3=['735','346','542'…
import sqlite3 con='' cur='' def connect(host): global con global cur try: con=sqlite3.con…
作者:vpoet 日期:大约在夏季 注:这些小demo都是前段时间为了学python写的,现在贴出来纯粹是为了和大家分享一下 #coding=utf-8 import urllib…
在web开发中经常用到验证码,为了防止机器人注册或者恶意登陆和查询等,作用不容小觑 但是验证码其实不是一个函数就能搞定的,它需要生成图片和水印,其实每种语言都有相关的函数生成图片和…
用Python实现一个简单的算术游戏 #!/usr/bin/env python from operator import add, sub from random import …
from PIL import Image, ImageDraw, ImageFont import os def water_work(img): x, y = img.size…
#encoding:utf8 import urllib2 import urllib import re import sys import os import time def…
本次爬取的贴吧是百度的美女吧,给广大男同胞们一些激励 在爬取之前需要在浏览器先登录百度贴吧的帐号,各位也可以在代码中使用post提交或者加入cookie 爬行地址:h…
python中email模块使得处理邮件变得比较简单,今天着重学习了一下发送邮件的具体做法,这里写写自己的的心得,也请高手给些指点。 &nbs…
import ssl import json from PIL import Image import urllib import re import urllib.request…
# To test it with netcat, start the script and execute: # # echo "Hello, cat." |…