专题文章
时长:00:00更新时间:2020-11-27 14:21:52
首先给出代码。,import ospath = ";/home/data//";path_exp = os.path.expanduser(path)classes = [int(p) for p in os.listdir(path_exp)]classes.sort()# nrof_classes一个数据集下有多少个文件夹,就是说有多少个人,多少个类别nrof_classes = len(classes)count=0files = open(";train_list.txt";,';w';)filets = open(";test_list.txt"。python下os模块的一下有用的用法。
查看详情