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")
사용자가 지정한 디렉토리에서 모든 .ppm 파일을 열려고합니다.Python - 디렉토리에서 .ppm 파일을 열 때 어떻게하나요?
'open ("r", encoding = "utf-8")은 무엇을해야합니까? 당신은 파일을 열지 않고 모드와 인코딩만을 전달합니다 ... – Pythonista
'ppm'은 이미지 파일입니까? 그렇다면 이미지 파일 작업을위한 베개와 같은 이미지 처리 모듈을 사용할 수도 있습니다. – Marcin