大道至简,规则无上。

导航

2018年2月10日 #

Python之OS内置模块

摘要: os.getcwd() 获取当前工作目录,即当前python脚本工作的目录路径 os.chdir("dirname") 改变当前脚本工作目录;相当于shell下cd os.curdir 返回当前目录: ('.') os.pardir 获取当前目录的父目录字符串名:('..') os.makedirs 阅读全文

posted @ 2018-02-10 10:46 大道至简,规则无上。 阅读(131) 评论(0) 推荐(0) 编辑

2018年2月8日 #

Python之file方法

摘要: def fileno(self): # 文件描述符 def flush(self): # 刷新文件内部缓冲区 def isatty(self): # 判断文件是否是同意tty设备 def next(self): # 获取下一行数据,不存在,则报错 def read(self, size=None): 阅读全文

posted @ 2018-02-08 16:00 大道至简,规则无上。 阅读(94) 评论(0) 推荐(0) 编辑

2018年2月7日 #

Git 转载

摘要: 我每天使用 Git ,但是很多命令记不住。 一般来说,日常使用只要记住下图6个命令,就可以了。但是熟练使用,恐怕要记住60~100个命令。 下面是我整理的常用 Git 命令清单。几个专用名词的译名如下。 Workspace:工作区 Index / Stage:暂存区 Repository:仓库区(或 阅读全文

posted @ 2018-02-07 09:11 大道至简,规则无上。 阅读(132) 评论(0) 推荐(0) 编辑

2018年2月6日 #

Python之set方法

摘要: class set(object): """ set() -> new empty set object set(iterable) -> new set object """ def add(self, *args, **kwargs): # 添加元素 """ Add an element to 阅读全文

posted @ 2018-02-06 20:08 大道至简,规则无上。 阅读(154) 评论(0) 推荐(0) 编辑

2018年2月5日 #

Python之字典方法

摘要: 1 abc #返回结果 2 def 3 hjk 阅读全文

posted @ 2018-02-05 15:10 大道至简,规则无上。 阅读(124) 评论(0) 推荐(0) 编辑

Python之元组方法

摘要: def count(self, value): # 计算元素出现的个数 """ T.count(value) -> integer -- return number of occurrences of value """ return 0def index(self, value, start=No 阅读全文

posted @ 2018-02-05 11:10 大道至简,规则无上。 阅读(114) 评论(0) 推荐(0) 编辑

Python之字符串方法

摘要: test = 'hello {0},age{1}' res = test.format('chenyan','19') print(res) hello chenyan,age19 #返回结果 i = ['hehe','haha'] res = '-'.join(i) print(res) hehe 阅读全文

posted @ 2018-02-05 10:33 大道至简,规则无上。 阅读(109) 评论(0) 推荐(0) 编辑

Python之列表方法

摘要: li = ['a','b','c','d'] l = ['e','f'] li.extend(l) print(li) ['a', 'b', 'c', 'd', 'e', 'f'] #返回结果 阅读全文

posted @ 2018-02-05 08:51 大道至简,规则无上。 阅读(154) 评论(0) 推荐(0) 编辑