Unless you're on windows, mangling linux paths, use os.path.split.
Or set os.sep to your liking.
This is not going to work with mixed windows and linux paths, unless you change the path separator appropriately, just before splitting.
Edit2: Setting os.path.sep WON'T make os.path.split or os.path.join behave any different. Sorry.
Edit: Um, right, os.path.split gets the final component.
There is, however, os.altsep, so path.replace(os.altsep,os.sep).split(os.sep) might be the way.
os.sep is by default set to your OS' preferred one.
os.pathsep is (on windows) what separates directories in PATH variable.
To make it reliable normalize the path (as suggested by @mhlester):
>>> os.path.normpath(r"C:/PythoN27\python.exe")
'C:\\PythoN27\\python.exe'
>>> os.path.normcase(r"C:/PythoN27\python.exe")
'c:\\python27\\python.exe'
var = ["some", "path", "to", "a", "certain unspecified", "folder"]