#-*- coding: utf-8 -*-
import os
import shutil
path = "/root/stock_py/data/data_tick1/"
target = "/root/stock_py/data/stockresult1.txt"
print target
appendfile = open(target, 'a+')
for roots, dirs, files in os.walk(path):
for ifile in files:
tempfile = roots + '/' + ifile
openfile = open(tempfile)
print tempfile
shutil.copyfileobj(openfile, appendfile)
openfile.close()
appendfile.close()
转载请注明原文地址: https://ju.6miu.com/read-157.html