I'm new to coding and have started to try out the OS module, it occasionally it will work on specific paths. example:
but when I try to interact with an individual file this will happen:
print(os.stat('my_file.txt'))
>>>filenotfounderror: [errno 2] no such file or directory found.
'my_file.txt'
or when I try to interact with a path that is not in my cwd then this would happen:
print(os.listdir(C:\folder\folder\folder))
>>>SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in
position 2-3: truncated \UXXXXXXXX escape
I don't understand why this is happening and it would be great if someone could explain why this is happening, thanks.
C:\folder\folder\folder