#!/usr/bin/env python #-*- coding:UTF-8 -*- import os ''' edited by zr date:2017.05.27 ''' path ='/home/zr/5-11-images/fuyangben/' f=open("all.txt",'w') for pic in os.listdir(path): f.write(os.path.join(path,pic)+' ') f.close()
结果是: