Python Check si existe la carpeta
import os
print(os.path.isdir("/home/el"))
print(os.path.exists("/home/el/myfile.txt"))
Homely Hamerkop
import os
print(os.path.isdir("/home/el"))
print(os.path.exists("/home/el/myfile.txt"))
>>> import os
>>> os.path.isdir('new_folder')
True
>>> os.path.exists(os.path.join(os.getcwd(), 'new_folder', 'file.txt'))
False
os.path.isdir("/home/el")
import os
os.path.isdir("/home/el") # Returns True if exist
os.path.exists("/home/el/myfile.txt") # Return False if not exist