上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 29 下一页
摘要: 在img目录下7张图片 分别是 11.jpg 22.jpg 33.jpg 44.jpg 55.jpg 66.jpg 77.jpg 在对应的文件下会创建thumbs 缩略图文件,然后 生成对应的缩略图,执行时间为: 0.109212875366 阅读全文
posted @ 2016-06-07 18:58 北京流浪儿 阅读(709) 评论(0) 推荐(0)
摘要: 方法1: 在Debian/Ubuntu Linux下直接通过apt安装: $sudo apt-get install python-imaging Mac和其他版本的Linux可以直接使用easy_install或pip安装,安装前需要把编译环境装好: $sudo easy_intall PIL 或 阅读全文
posted @ 2016-06-07 14:00 北京流浪儿 阅读(3534) 评论(0) 推荐(1)
摘要: Python find() 方法检测字符串中是否包含子字符串 str ,如果指定 beg(开始) 和 end(结束) 范围,则检查是否包含在指定范围内,如果包含子字符串返回开始的索引值,否则返回-1 find()函数语法:str.find(str, beg=0, end=len(string)) 参 阅读全文
posted @ 2016-06-07 10:14 北京流浪儿 阅读(1365) 评论(0) 推荐(0)
摘要: # -*- coding: utf-8 -*- # from multiprocessing import Pool 多进程 from multiprocessing.dummy import Pool as ThreadPool import time import urllib2 urls = [ 'http://www.python.org', 'http://www.... 阅读全文
posted @ 2016-06-06 16:46 北京流浪儿 阅读(1035) 评论(0) 推荐(0)
摘要: 转自:http://www.cnblogs.com/end/archive/2012/06/18/2553682.html 1.内置运算符1.1关系运算符 运算符 类型 说明 A = B 所有原始类型 如果A与B相等,返回TRUE,否则返回FALSE A == B 无 失败,因为无效的语法。 SQL 阅读全文
posted @ 2016-06-06 12:24 北京流浪儿 阅读(215) 评论(0) 推荐(0)
摘要: #Python的os.path模块提供了 isdir() 和 isfile()函数,请导入该模块,并调用函数判断指定的目录和文件是否存在。 import os print os.path.isdir(r'/data/webroot/resource/python') #存在则返回:true print os.path.isfile(r'/data/webroot/resource/pyth... 阅读全文
posted @ 2016-06-06 11:49 北京流浪儿 阅读(548) 评论(0) 推荐(0)
摘要: 在Python中定义函数,可以用必选参数、默认参数、可变参数和关键字参数,这4种参数都可以一起使用,或者只用其中某些,但是请注意, 参数定义的顺序必须是:必选参数、默认参数、可变参数和关键字参数。 请看实例代码: 总结: 要注意定义可变参数和关键字参数的语法: *args是可变参数,args接收的是 阅读全文
posted @ 2016-06-01 17:35 北京流浪儿 阅读(188) 评论(0) 推荐(0)
摘要: 方法1tmp_channel_hive_file="/tmp/tmp_channel_hive_file"tmp_channel_hive_file_new="/tmp/tmp_channel_hive_file_new"db="t_merchant_shop_channel_top_daily_n 阅读全文
posted @ 2016-06-01 12:28 北京流浪儿 阅读(477) 评论(0) 推荐(0)
摘要: 有两个文件一个是 文件1:sync_shop_source_bimer.sh 文件2:sync_shop_source_bimer.py 在sync_shop_source_bimer.sh 中调用sync_shop_source_bimer.py 文件1中产生的文件要传递给文件2 文件1中的内容 阅读全文
posted @ 2016-06-01 12:16 北京流浪儿 阅读(401) 评论(0) 推荐(0)
摘要: python的pickle模块实现了基本的数据序列和反序列化。通过pickle模块的序列化操作我们能够将程序中运行的对象信息保存到文件中去,永久存储;通过pickle模块的反序列化操作,我们能够从文件中创建上一次程序保存的对象。 基本接口: pickle.dump(obj, file, [,prot 阅读全文
posted @ 2016-05-24 23:05 北京流浪儿 阅读(574) 评论(0) 推荐(0)
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 29 下一页