随笔分类 -  python

摘要:#! usr/bin/python #coding=utf-8 import urllib2 fp = open('test', 'wb') req = urllib2.urlopen('http://192.168.230.138/index.zip') for line in req: if not line: break fp.write(line) f... 阅读全文
posted @ 2017-10-12 14:51 破冰Lab-Cookun 阅读(1369) 评论(0) 推荐(0) 编辑
摘要:GET 添加headers头import urllib2 request = urllib2.Request(uri) request.add_header('User-Agent', 'fake-client') response = urllib2.urlopen(request) POST 空数据import urllib2 request = urllib2.Request(u... 阅读全文
posted @ 2017-08-15 17:45 破冰Lab-Cookun 阅读(352) 评论(0) 推荐(0) 编辑
摘要:googlecode :https://code.google.com/archive/p/python-proxy/source/default/source # -*- coding: cp1252 -*- # # #Copyright (c) # #Permission is hereby granted, free of charge, to any person #obtain... 阅读全文
posted @ 2016-09-26 13:49 破冰Lab-Cookun 阅读(363) 评论(0) 推荐(0) 编辑
摘要:!/usr/bin/env python # encoding: utf-8 import urllib from pypinyin import pinyin, lazy_pinyin def toString(piny): if len(piny): print ''.join(lazy_pinyin(piny)) def getLis... 阅读全文
posted @ 2016-09-22 15:11 破冰Lab-Cookun 阅读(237) 评论(0) 推荐(0) 编辑
摘要:去空格及特殊符号s.strip().lstrip().rstrip(',')复制字符串#strcpy(sStr1,sStr2)sStr1 = 'strcpy'sStr2 = sStr1sStr1 = 'strcpy2'print sStr2连接字符串#strcat(sStr1,sStr2)sStr1... 阅读全文
posted @ 2014-11-05 09:54 破冰Lab-Cookun 阅读(174) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示