The existing answers are correct for your "real basic question" (path manipulation). For the question in your heading (generalized to other characters, of course) that the rsplitstring method helps :
>>> s='some/stuff/with/many/slashes'
>>> s.rsplit('/', 1)
['some/stuff/with/many', 'slashes']
>>> s.rsplit('/', 1)[1]
'slashes'
>>>
source
share