python怎么获取文件夹的路径

python如何获取文件夹的路径
我只懂得获取文件夹中具体文件的路径,而不会获取文件夹的路径,求高手指点

------解决方案--------------------
dialog = wx.DirDialog(self, "Choose a directory", os.getcwd())
------解决方案--------------------
os.path.split(path). 将path分割成目录和文件名二元组返回。

参考文档:http://docs.python.org/library/os.path.html
os.path.split(path)
Split the pathname path into a pair, (head, tail) where tail is the last pathname component and head is everything leading up to that. The tail part will never contain a slash; if path ends in a slash, tail will be empty. If there is no slash in path, head will be empty. If path is empty, both head and tail are empty. Trailing slashes are stripped from head unless it is the root (one or more slashes only). In all cases, join(head, tail) returns a path to the same location as path (but the strings may differ).