import os for file in os.listdir("D:/Master Studies/WS16-17/TKPraktikum/Python Tutorial/test"): # if file.endswith(".*"): print(file)