代码拉取完成,页面将自动刷新
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 9 19:29:39 2018
@author: Administrator
"""
import os
import pandas as pd
import math
pic_path = r'f:\资源照片一站一档'+'\\'
out_path = r'd:\test'+'\\'
pic_list = []
for root, dirs, files in os.walk(pic_path):
for name in files:
pic_list.append(os.path.join(root, name))
for i in range(0,math.ceil(len(pic_list)/10000),1):
with open(out_path + '图片列表' + str(i) + '.csv' ,'w') as writer:
df_out = pd.DataFrame()
df_out['pic_path'] = ''
if (i+1)*10000 < len(pic_list):
for j in range(i*10000,(i+1)*10000,1):
df_out.loc[j,'pic_path'] = pic_list[j]
df_out.to_csv(writer)
if (i+1)*10000 > len(pic_list):
for j in range(i*10000,len(pic_list),1):
df_out.loc[j,'pic_path'] = pic_list[j]
df_out.to_csv(writer)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。