>>> import os
>>> c = os.getcwd()
>>> c
'C:\\Users\\ashab'
>>> d = os.path.split(c)
>>> d
('C:\\Users', 'ashab')
>>> test_folder = r'C:\Program Files\Common Files\Adobe'
>>> d_test_folder = os.path.split(test_folder)
>>> d_test_folder
('C:\\Program Files\\Common Files', 'Adobe')
>>> d_test_folder[0]
'C:\\Program Files\\Common Files'
>>>