V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
V2EX  ›  AILOVEU  ›  全部回复第 1 页 / 共 1 页
回复总数  15
@Cooky 其实我的问题用字符串表示更确切些,即“ string ”变成“ stng ”。当然字符串这样比喻也只是为了方便说明,最最最终是 b'xxx',这种的截取
@lc1450 Using scandir() instead of listdir() can significantly increase the performance of code that also needs file type or file attribute information
如果不用 yield,递归是很容易实现的,因为最近学到了,所以就想把它包装成一个方法; os.walk 也可以勉强完成处理后复制文件的功能,但用起来会很别扭
@lc1450 是指替换 os.listdir 吧
@jeadong 什么啊?
@liukrystal 不光是遍历,主要是第二个参数,可以用于复制文件等
@neoblackcap 不能复制到新的文件夹下,它只能遍历
这个帖子上去啊
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1050 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 15ms · UTC 23:05 · PVG 07:05 · LAX 16:05 · JFK 19:05
♥ Do have faith in what you're doing.