Skip to content

Instantly share code, notes, and snippets.

View taojy123's full-sized avatar

taojy123 taojy123

View GitHub Profile
@taojy123
taojy123 / im2str.py
Created December 25, 2014 03:11
利用StringIO存取图片
from PIL import Image
import StringIO
s = open("1.jpg", "rb").read()
im = Image.open(StringIO.StringIO(s))
im.save("2.jpg", "jpeg")
sio = StringIO.StringIO()
@taojy123
taojy123 / cookie_post.py
Last active August 29, 2015 14:11
Python 模拟POST发包,并且保存cookie,可用于需要登录的操作
#coding=utf8
import cookielib
import urllib2, urllib
import time
import re
import traceback
import time
@taojy123
taojy123 / checkbox.html
Created October 30, 2014 05:18
JQuery 全选按钮
<input type="checkbox" onclick="$('input[type=checkbox]').prop('checked', $(this).prop('checked'))">
@taojy123
taojy123 / post_files.py
Created October 28, 2014 01:53
Python 模拟POST发包上传文件
# requests
import requests
r = requests.post("http://127.0.0.1:8000/input_file/", files={"file": open("a.txt", "rb")})
print r.url
print r.text
# poster