代码:
import os path = r"C:\Users\Administrator\Desktop\***" print('filenum:',len([lists for lists in os.listdir(path) if os.path.isfile(os.path.join(path, lists))]))