How do I make the file path like C:UserssDesktop989scene06241.png to file path like C:UserssDesktop989scene06241.png or C:UserssDesktop989scene06241.png in python?
exactly how to make this file path to unicode
folder_path = "C:\Users\s\Desktop\989"
image_extensions = [".jpg", ".jpeg", ".png", ".gif", ".bmp"]
# Get all files from the folder
all_files = os.listdir(folder_path)
# Filter files based on extensions to get only images
image_files = [f for f in all_files if any(f.endswith(ext) for ext in image_extensions)]
# Iterate through image files
for image_file in image_files:
full_path = os.path.join(folder_path, image_file)
print(full_path)
make full_path to C:\Users in window
I had tried multiple they don’t work. And there is no enough materials about this. I hope I can have a easy way to make it work.In this code I tried to automatically change make all the full_path goes from ”to ”