SyntaxFix
Write A Post
Hire A Developer
Questions
I would do
import os path = os.path.normpath(path) path.split(os.sep)
First normalize the path string into a proper string for the OS. Then os.sep must be safe to use as a delimiter in string function split.
os.sep