Blog

What does the following code do?

import os

for file in os.listdir(“/mydir”):

if file.endswith(“.txt”):

print(os.path.join(“/mydir”, file))