码迷,mamicode.com
首页 >  
搜索关键字:zen coding    ( 13130个结果
PYTHON WEATHER
小玩一下python强大的库文件,调api获取天气情况#coding:utf-8import urllibimport jsoncontent = urllib.urlopen('http://m.weather.com.cn/data/101040100.html').read()s = json...
分类:编程语言   时间:2014-09-14 19:14:57    阅读次数:229
python练习程序(批量重命名)
# -*- coding: cp936 -*-import sys,os,stringd=0;path="F://test"srcfile=os.listdir(path)for i in srcfile: src=path+"//"+i dst=path+"//"+str(d)+".t...
分类:编程语言   时间:2014-09-14 14:04:47    阅读次数:184
用python批量转换图片
需求是这样的,由于现在相机像素都很高,拍出来的照片很大,上传到网上相册太慢,于是要先转下大小,之前都是直接在网上搜图片处理的软件,后来想了一下,既然会编程,这种需求完全可以自己动手搞。 python的图片处理爽歪歪,几行代码搞定,这里用的是pillow库。 下面上代码。 #coding=utf-8 from PIL import Image#需要pillow库 import glob, os...
分类:编程语言   时间:2014-09-13 20:09:55    阅读次数:184
Python的Internet标准库2-urllib组件
访问不需要验证的远程资源下载数据,使用urlretrieve() 1 #!/usr/bin/env python 2 # -*- coding: utf-8 -*- 3 4 import urllib 5 6 def report(blocks_read,block_size,total_siz.....
分类:编程语言   时间:2014-09-13 18:28:35    阅读次数:183
python 网络爬虫,python 网络爬虫
#-*-coding:utf-8-*-#python:2.x__author__='Administrator'importurllib2#例子LOGIN='wesc'PASSWD="you'llNeverGuess"URL='http://localhost'defh1(url):fromurlp...
分类:编程语言   时间:2014-09-13 17:10:35    阅读次数:247
Python的Internet标准库1
urlparse分解URL 1 #!/usr/bin/env python 2 # -*- coding: utf-8 -*- 3 4 from urlparse import urlparse 5 6 url = 'http://www.baidu.com' 7 8 parsed = url...
分类:编程语言   时间:2014-09-13 08:17:04    阅读次数:197
Python BeautifuSoup4 爬表格
#?-*-coding:utf-8-*- import?os import?sys from?bs4?import?BeautifulSoup reload(sys) sys.setdefaultencoding("utf-8") fp?=?open(‘txt.txt‘,‘a‘) for?i?in?range(3): ????path?=?sys.arg...
分类:编程语言   时间:2014-09-12 23:35:24    阅读次数:582
python 根据文件创建时间排序
#coding:utf8import os,timedirectory = "d:/scrapy tutorial/"t = []d = {}for filename in os.listdir(directory): path = directory + filename ...
分类:编程语言   时间:2014-09-12 22:02:04    阅读次数:313
转载翻译简介:关于Flash and C++ Native Extension C++扩展ANE——2
做人呢就要有始有终不是么。。我还是把这个翻译完了事。Coding with C++With the C++ project finally set up, it's time to start adding some code. We'll start with the NativeAdd.h fi...
分类:编程语言   时间:2014-09-12 17:06:33    阅读次数:252
用python实现的抓取腾讯视频所有电影的爬虫
1. [代码]用python实现的抓取腾讯视频所有电影的爬虫 # -*- coding: utf-8 -*-# by awakenjoys. my site: www.dianying.atimport reimport urllib2from bs4 import BeautifulSoupim....
分类:编程语言   时间:2014-09-12 17:01:43    阅读次数:422
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!