原创 python 字典詳解 二(字典拓展使用 )

前言 本文將涵蓋在一些特殊用途的字典,如OrderedDict, defaultdict, ChainMap, Counter,它們都在 collections 類庫下面,另外還有 types下面的MappingProxyType

原创 例子說明tell, seek, truncate基本用法

from io import StringIO memory_file = StringIO() memory_file.write('hello stringio') #文件的當前位置,即tell是獲得文件指針位置 memory_fil

原创 算法小題目練習

計算今年還剩餘多少天 #!/usr/bin/env python import sys import logging from collections import OrderedDict __author__ = 'thomas'

原创 robotframework 是如何根據output收集失敗的case的

前面博客分析了,設置的時候,如果參數裏面包含有–rerunfailed選項,那麼就會去收集失敗的用例,並放到case執行的列表當中的, 那麼具體收集過程是怎麼樣子的了,大體過程如下: 首先, 要達到的目標是, ExecutionResul

原创 github搜索技巧

language:python 跟python語言有關 location:beijing: 地點北京 user:thomas-23: 精確定位某個人 stars:>10: 加星超過10人的項目 created:>2016-01-1

原创 python獲取當前腳本下的所有方法

import ast def top_level_functions(body): #判斷是不是方法 return (f for f in body if isinstance(f, ast.FunctionDef))