code
>>> import os >>> dir, suffix = os.path.splitext("test.pdf") >>> dir 'test' >>> suffix '.pdf' >>> dir, suffix = os.path.splitext("/root/test.pdf") >>> dir '/root/test' >>> suffix '.pdf' >>>