# def fileappend(f1,f2): # print "This is to append many files lines by lines" # f1=open('C:/f1.txt','w') # f1=open('C:/f1.txt','w') # f3=open('C:/f1.txt','w') #copy file/folder function # import shutil, errno # def copyanything(src, dst): # try:shutil.copytree(src, dst) # except OSError as exc: # python >2.5 # if exc.errno == errno.ENOTDIR: # shutil.copy(src, dst) # else: raise import os, sys from decimal import * def test(num_files, *args): path=args num_files = int(Decimal(num_files)) final_file= open("C:/final_file.txt","w") i = 0 while (i <= num_files): f= open(path[i],"r") if (path[i]<> ""): for line_data in f: final_file.writelines(line_data) i = +1 break f.close() if f.closed==True: print "CLOSED" else: print "NOT OK" final_file.close() #def argument1(self,**args): #path=args #while (path < > ""): #f #f1_path="C:/a/a.txt" #f2_path="C:/b/b.txt" #f3_path="C:/c/c.txt" #f4_path="C:/c/d.txt" #final_path="C:/final.txt" ##f3_path=copyanything(f1_path,"C:/abc.txt") #f1=open(f1_path,'r') #f2=open(f2_path,'r') #f3=open(f3_path,'r') #f4=open(f4_path,'r') #final=open(final_path,'w') #for line1_data in f1: #final.writelines(line1_data) #for line2_data in f2: #final.writelines(line2_data) #for line3_data in f3: #final.writelines(line3_data) #for line4_data in f4: #final.writelines(line4_data) #break #break #break #f1.close() #f2.close() #f3.close() #f4.close() #final.close()