学学依一
daodao18
以个造
展开
-
json
json文件的使用方式json 全称 JavaScript object notation,是一种轻量级的数据交换格式。python中的json模块提供了json数据的处理功能。python中最常用的基本数据结构之一就是字典,其典型结构如下:d = { 'a': 123, 'b': { 'x': ['A', 'B', 'C'] }}而json的结...原创 2019-01-15 10:55:33 · 189 阅读 · 0 评论 -
argparse
recommended command-line parse modulels - default usagels dir - position argument 位置参数,仅依赖于 where on the command linels -l - optional argument--help - come across a program without using it before...原创 2019-01-15 10:59:50 · 116 阅读 · 0 评论 -
os+glob
osimport osos.getcwd() # 显示当前文件夹路径os.listdir(dir_path) # 列举目录下的所有文件os.listdir('.') # 显示当前文件夹下的所有文件# os.pathos.path.abspath(path) # 返回path的绝对路径os.path.split(os.getcwd()) # 将路径分解为(文件夹,文件名),返回元组...原创 2019-01-15 11:01:16 · 210 阅读 · 0 评论 -
txt+csv
##---txt---##def open(file, mode='r', ...): 'r' read only 'w' override 'a' appending open 之后:with open(file, 'r') as f: # 不全部放在内存里,即用即读 for line in f: do_sth(line) ...原创 2019-01-15 11:20:15 · 213 阅读 · 0 评论 -
io+plt+cv2
搞清楚skimage、matplotlib、cv2之间的共通与区别。skimageskimage下有很多包,常用的应该是io,data,transform# read and show imageimg1 = io.imread(fname) # dtype=uint8print(img1.shape)print(img1[:1,:3,:])io.imshow(img1)io.sh...原创 2019-01-15 11:21:00 · 251 阅读 · 0 评论 -
Crawl byBeautifulSoup
基础知识HTML-hyper text markup language,超文本链接标示语言。利用类似<a>, <\a>的标签来识别内容,然后通过浏览器的实现标准来翻译成精彩的页面。当然,一个好看的网页并不仅仅有HTML,毕竟字符串是静态的,只能实现静态效果,要做出漂亮的网页还需要能美化样式的CSS和动态效果的JavaScript。DOM-document object ...原创 2019-01-22 12:15:36 · 265 阅读 · 0 评论