首页 软件开发 代码片段 python ( Page 88 )

python 1073

#Python
python3爬取糗百硬菜图片 转自www.ustchacker.com

import urllib.request import re import threading images=[] def touchImages(): url='http://…

2014-11-01 335

#Python
修改mp3的id3 tag内容

#! /usr/bin/env python # encoding: utf8 import sys import os import binascii import json d…

2014-10-31 283

#Python
对比list的处理速度

#网上代码 def open_httptxt(): #打开TXT文本写入数组 st=time.clock() try: passlist = [] list_passlist=[]…

2014-10-31 521

#Python
将华氏温度转换成摄氏温度,或者相反

#-*- charset:utf-8 -*- #This program will follow users intention to convert F to C or the …

2014-10-31 453

#Python
无第三方模块抓取京*东所有iPhone手机价格

chrome按f11找价格部分相关的东西,urllib2单纯爬下来怎么就没价格, 想想可能是jq做的,于是另存所有,开sublime, findall价格相关的各种id,于是乎就找…

2014-10-30 434

#Python
Flask 文件上传

import os from flask import Flask, request, redirect, url_for from werkzeug import secure_…

2014-10-29 417

#Python
python实现堆排序

#沿左,右子节点较大者依次往下调整 def heapify( array, i, n ): j = i * 2 + 1 while j < n: if j + 1 < …

2014-10-29 575

#Python
python爬取返利网商品信息

#coding=utf-8 import sys reload(sys) sys.setdefaultencoding( "utf-8" ) import urllib2 impo…

2014-10-29 338

#Python
python将list连续元素和非连续元素分开转换为指定字符串

obj = {} def test(nums): nums.append(0) for item in nums: start = obj.get('start', item) e…

2014-10-28 970

#Python
演示类和继承

class Employee: pass lee = Employee() lee.name = 'leefang' lee.age = 28

2014-10-27 775

#Python
Python生成随机密码

# -*- coding:utf8 -*- import random import string import sys reload(sys) sys.setdefaultenc…

2014-10-27 649