是否可以在python中初始化一个空的csv文件?我想初始化一个,然后将目录中的每个csv文件逐个合并到其中。
答案 0 :(得分:0)
read()
write()
可以通过open('file' 'a')
向append
和files = ['the', 'files', 'here']
output = '/output/file/here'
for file in files:
with open(file, 'r') as input_file:
with open(output, 'a') as output_file:
output_file.write(input_file.read())
发送文件
spa.factory("linkFactory", function() {
var linkFactoryObject = {};
linkFactoryObject.currentLink = "home";
linkFactoryObject.setRoute = function(route)
{
linkFactoryObject.currentLink = route;
};
return linkFactoryObject;
});
spa.run(['linkFactory','$rootScope',function(linkFactory,$rootScope) {
$rootScope.$on('$routeChangeStart', function(event, next, current) {
linkFactory.setRoute(next.$$route.originalPath);
});
});
无需先创建空文件。