1👍
✅
How are you populating filepath
? Most likely you are constructing it using Linux file path convention, Linux uses front-slash (/
) as path separator whereas Windows uses back-slash (\
). Use Python’s os.path
module to formulate file paths in a platform independent manner.
#prints spam\egg on Windows and spam/egg on Linux
print os.path.join('spam', 'egg')
Source:stackexchange.com