shutil.move(src, dest) 方法是否调用 os.system() 方法或 bash 命令“mv”和“cp”?
P.S : 我在网上搜索但找不到任何有用的信息。
最佳答案
使用来源卢克:
http://hg.python.org/cpython/file/2.7/Lib/shutil.py
实际上两者都不做。 如果您遵循代码,它最终会打开一个新的文件描述符并将缓冲字节写入其中。像这样:
while 1:
buf = fsrc.read(length)
if not buf:
break
fdst.write(buf)
关于python - Python shutil 模块中的 shutil.move() 方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25296588/