会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Sawyer Ford
博客园
首页
新随笔
联系
管理
订阅
上一页
1
2
3
4
5
6
7
8
9
···
22
下一页
2017年8月8日
python的with
摘要: with 语句适用于对资源进行访问的场合,确保不管使用过程中是否发生异常都会执行必要的“清理”操作,释放资源。 比如文件使用后自动关闭、线程中锁的自动获取和释放等。 运行机制 等价于 VAR对应一个上下文管理器(context manager)。 上下文管理器 实现了__enter__()和__ex
阅读全文
posted @ 2017-08-08 21:44 Sawyer Ford
阅读(175)
评论(0)
推荐(0)
2017年8月7日
python http server handle json
摘要: 用Python实现一个http server python post json的两种方法:
阅读全文
posted @ 2017-08-07 20:51 Sawyer Ford
阅读(3992)
评论(0)
推荐(0)
c++文件读写
摘要: 先上一张镇楼图 再来一个demo PS: http://www.cplusplus.com/reference/cstdio/sscanf/
阅读全文
posted @ 2017-08-07 16:32 Sawyer Ford
阅读(187)
评论(0)
推荐(0)
2017年8月6日
python字符串处理
摘要: 字符串处理绝对是任何一门语言的重点。 str.partition(sep) Split the string at the first occurrence of sep, and return a 3-tuple containing the part before the separator,
阅读全文
posted @ 2017-08-06 12:04 Sawyer Ford
阅读(196)
评论(0)
推荐(0)
2017年8月5日
python decorator
摘要: decorator(装饰器)绝对是Python学习道路上的一个拦路虎。想要理解它,先看两个概念。 nested function(内嵌函数) 类似于函数局部变量,内嵌函数就是函数的局部函数。 Python的内嵌函数有个特点,它可以访问自身作用域外围的变量。 内嵌函数is_even可以直接访问外围参数
阅读全文
posted @ 2017-08-05 15:08 Sawyer Ford
阅读(175)
评论(0)
推荐(0)
2017年8月4日
python模块之time and datetime
摘要: time 输出: timestamp:1505887820.714079, type: <class 'float'>localtime: time.struct_time(tm_year=2017, tm_mon=9, tm_mday=20, tm_hour=14, tm_min=10, tm_s
阅读全文
posted @ 2017-08-04 15:48 Sawyer Ford
阅读(223)
评论(0)
推荐(0)
2017年8月2日
Linux命令之find
摘要: find是一个使用非常频繁的命令。 基于文件时间的查找 Linux下的每个文件有三种时间戳 atime,access time mtime,modify time, 文件内容的修改 ctime,change time,文件权限或属性的修改 find的一个重要参数: -exec 对于每个匹配的文件,{
阅读全文
posted @ 2017-08-02 09:34 Sawyer Ford
阅读(240)
评论(0)
推荐(0)
2017年7月31日
Python之os模块
摘要: os是个常用的模块,必须熟练。 参考资料: https://docs.python.org/3/library/os.html How do I remove/delete a folder that is not empty with Python?
阅读全文
posted @ 2017-07-31 20:46 Sawyer Ford
阅读(164)
评论(0)
推荐(0)
Shell脚本(五)函数
摘要: 总结下shell中的函数用法
阅读全文
posted @ 2017-07-31 09:53 Sawyer Ford
阅读(125)
评论(0)
推荐(0)
2017年7月28日
Shell脚本(四)数组
摘要: 平时写脚本还没有用到过数组,暂时先记录下用法。
阅读全文
posted @ 2017-07-28 17:51 Sawyer Ford
阅读(179)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
9
···
22
下一页
公告