Skip to content

Commit

Permalink
遍历大小: 处理异常; 首页整理
Browse files Browse the repository at this point in the history
  • Loading branch information
testacount1 committed Jan 21, 2021
1 parent f6f42f1 commit 776ab35
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
8 changes: 6 additions & 2 deletions 1-基础/找大垃圾/遍历大小.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

# 使用者自行修改
扫描路径 = "/Library"
比这大 = 200 *
比这大 = 500 *
#####

各文件大小 = {}
Expand All @@ -20,9 +20,13 @@ def 遍历目录(起始路径 = '.'):
for 路径, 目录名, 所有文件 in os.walk(起始路径):
for 文件 in 所有文件:
文件路径 = os.path.join(路径, 文件)

# 如果是符号链接, 跳过
if not os.path.islink(文件路径):
文件大小 = os.path.getsize(文件路径)
try:
文件大小 = os.path.getsize(文件路径)
except:
print("取不了大小:" + 文件路径)
各文件大小[文件路径] = 文件大小

if 路径 in 各路径大小:
Expand Down
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
> good good study, day day up
因地制宜,在编程中尽可能使用中文进行代码编写和教学。

因地制宜,在编程中尽可能使用中文进行代码编写和教学(demo oriented
集合了一些日常小工具,其中成文的一部分如下:

流程规范:
1. 用issue进行提问和讨论
2. 同样的问题可以有多种实现,举一反三
3. 在编程环境不受限的情况下,优先使用最合适的方案实现(比如涉及并发的时候,优先用elixir
4. 编写demo的默认编程语言是python,其次是typescript和APL/[q](https://code.kx.com/q)

在线调试:https://repl.it
- [新冠中医处方形成知识库过程中发现的药名问题(JavaScript)](https://zhuanlan.zhihu.com/p/119299775)
- [草蟒 Python 中文 API 与 VS Code 支持尝鲜](https://zhuanlan.zhihu.com/p/102811665)
- [自制TTS引擎第0.01步-Python实现拼接单字wav文件](https://zhuanlan.zhihu.com/p/85486162)
- [Python读取解析xml文件,顺便转换为大疆机甲大师可以演奏的乐谱](https://zhuanlan.zhihu.com/p/89736491)
- [五行Python代码由png图片生成gif文件](https://zhuanlan.zhihu.com/p/89394860)
- [在 PyPI 发布 Python 纯文字游戏试水——猜数字](https://zhuanlan.zhihu.com/p/141758876)
- [扩展Python控制台实现中文反馈信息](https://zhuanlan.zhihu.com/p/56411693)
- [Beyond的歌里最多是"唏嘘"吗? - Python分词+词频](https://zhuanlan.zhihu.com/p/55949416)
- [RPLY 入门例程中文化](https://zhuanlan.zhihu.com/p/104345761)

0 comments on commit 776ab35

Please sign in to comment.