12 2022 档案

摘要:20221220 glob.glob(path_name)会返回一个符合path_name的list 如果你使用: glob.glob('*')等同于使用os.listdir('./'). 参考: [1] https://www.pynote.net/archives/852 阅读全文
posted @ 2022-12-20 14:48 xiaoxuxli 阅读(166) 评论(0) 推荐(0)
摘要:20221220 使用python调用系统命令的时候需要用到os.system。 具体用法是: os.system(cmd_string) 参考: [1] https://www.cnblogs.com/liuhaidon/p/12077007.html 阅读全文
posted @ 2022-12-20 14:22 xiaoxuxli 阅读(68) 评论(0) 推荐(0)
摘要:20221111 c = a if a>b else b Reference: [1] https://blog.csdn.net/zm429438709/article/details/80213414 阅读全文
posted @ 2022-12-11 20:20 xiaoxuxli 阅读(35) 评论(0) 推荐(0)
摘要:20221111 Sort with custom function using key list.sort(key=len) or sorted(list, key=len) # take second element for sort def takeSecond(elem): return e 阅读全文
posted @ 2022-12-11 20:19 xiaoxuxli 阅读(15) 评论(0) 推荐(0)
摘要:It has been a few months since I finished my PhD study about bone CT processing via deep learning. During the journey, I have tried many methods, and 阅读全文
posted @ 2022-12-07 14:17 xiaoxuxli 阅读(156) 评论(0) 推荐(0)
摘要:20221207 We can use os.listdir() to list all files and folders under one root folder. When we want to list all subfolders and sub files under one root 阅读全文
posted @ 2022-12-07 08:30 xiaoxuxli 阅读(77) 评论(0) 推荐(0)
摘要:20221205 向下取整 向下取整直接用内建的 int() 函数。 int(a) 四舍五入 对数字进行四舍五入用 round() 函数 round(3.25); round(4.85) 向上取整 向上取整需要用到 math 模块中的 ceil() 方法: import math math.ceil 阅读全文
posted @ 2022-12-05 10:33 xiaoxuxli 阅读(66) 评论(0) 推荐(0)