If I have a json directory structure that lists paths in mac format ()i.e.
"/0000_test/video.mp4" and I want to join it with c:\\ the mac format, is there a way to do this?
So on windows the path would be returned as c:\\0000_test\video.mp4"
I have tried os.path.join to no avail
You can use os.path.join and os.path.normpath
>>> os.path.normpath(os.path.join('C:', '/0000_test/video.mp4'))
'C:\\0000_test\\video.mp4'
normpath will take care of normalizing the path in a platform specific manner.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With