Python folder path string escape character error

24 Views Asked by At

I am trying to iterate through a directory and I copied its file path from right clicking it.

It gives an escape character error. How do I present the folder address so It works?

folder_dir = "C:\Users\geniu\OneDrive\GW\Spring 2024\CSCI 6527\test_images"

Error:

SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 1-2: truncated \UXXXXXXXX escape

0

There are 0 best solutions below