📜  python 如何计算 fodler 中的每个 yfile - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:59.153000             🧑  作者: Mango

代码示例9
import os
isfile = os.path.isfile
join = os.path.join

directory = 'mydirpath'
number_of_files = sum(1 for item in os.listdir(directory) if isfile(join(directory, item)))