随笔分类 -  Python

摘要:import numpy as np 1.创建 a = np.array([[0,1],[0,1]]) 2.合并 a =np.array([[1,2],[4,5]]) b =np.array([[9,8],[6,5]]) np.concatenate((a,b)) array([[1, 2,], [ 阅读全文
posted @ 2016-10-18 21:30 Shiyu_Huang 阅读(160) 评论(0) 推荐(0) 编辑
摘要:document:http://effbot.org/imagingbook/pil-index.htm http://pillow.readthedocs.io/en/3.1.x/index.html from PIL import Image 1.打开图片 img = Image.open(fi 阅读全文
posted @ 2016-10-13 11:13 Shiyu_Huang 阅读(606) 评论(0) 推荐(0) 编辑
摘要:int(x [,base]) 将x转换为一个整数 long(x [,base] ) 将x转换为一个长整数 float(x) 将x转换到一个浮点数 complex(real [,imag]) 创建一个复数 str(x) 将对象 x 转换为字符串 repr(x) 将对象 x 转换为表达式字符串 eval 阅读全文
posted @ 2016-10-13 11:08 Shiyu_Huang 阅读(163) 评论(0) 推荐(0) 编辑
摘要:1.最近比较喜欢的用法: from concurrent.futures import ProcessPoolExecutor, as_completed ex = ProcessPoolExecutor(max_workers=50) tasks = [ex.submit(process_func 阅读全文
posted @ 2016-10-12 22:17 Shiyu_Huang 阅读(211) 评论(0) 推荐(0) 编辑
摘要:Python之异常 阅读全文
posted @ 2016-10-12 16:18 Shiyu_Huang 阅读(134) 评论(0) 推荐(0) 编辑
摘要:Github:https://github.com/huangshiyu13/PythonFileLib 1.获得文件夹下所有文件名 for file in os.listdir(imageDir): file_path = os.path.join(imageDir, file) if os.pa 阅读全文
posted @ 2016-09-21 11:03 Shiyu_Huang 阅读(417) 评论(0) 推荐(0) 编辑
摘要:1.写文件 f = open('out.txt','w') f.write('%s %d %d %d %d 0 0 0 0 0 0 0'%(bbx.name,bbx.x,bbx.y,bbx.w,bbx.h)) f.close() 2.读文件 第一种 f = open("foo.txt") # 返回一 阅读全文
posted @ 2016-08-12 23:24 Shiyu_Huang 阅读(253) 评论(0) 推荐(0) 编辑

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