Reputation:
import os
import glob
path = input("Please enter the directory you want to get the files from. -> ")
for filename in glob.glob(os.path.join(path, '*.ppm')):
open("r", encoding="utf-8")
I am trying to open all .ppm files in a user given directory.
Upvotes: 0
Views: 1096
Reputation: 77347
You keep trying to open a file named "r". Try adding the filename.
import os
import glob
path = input("Please enter the directory you want to get the files from. -> ")
for filename in glob.glob(os.path.join(path, '*.ppm')):
file_obj = open(filename, "r", encoding="utf-8")
Upvotes: 2