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.