How to speed up process in Python
Hello. I have this code here that basically puts text documents into 1 text document. filenames = [â10k mails_1â, â10k mails_2â, ...] with open(âC:\Users\Caesar Ronin \Desktop\All Mails.txtâ, âwâ) as outfile: for fname in filenames: with open(fname) as infile: for line in infile: outfile.write(line) It works perfectly, however, I want to put in multiple .txt documents at where the ... is at, without having to write them 1 by 1. Could there be a code that for example lets me add +1 to the end of the .txt at filenames since theyâre numbered with the same filename? So maybe a loop that adds +1 so it becomes 10k mails_3, 10k mails_4 etc. up until for example < 100 without me having to write the full name, or even the numbers.