You are on page 1of 1

Solution

Section 3, Lecture 72
1. import glob2
2. from datetime import datetime
3.
4. filenames = glob2.glob("*.txt")
5. with open(datetime.now().strftime("%Y-%m-%d-%H-%M-%S-%f")+".txt", 'w') as file:
6. for filename in filenames:
7. with open(filename, "r") as f:
8. file.write(f.read() + "\n")

You might also like