How to separate filename from path using Python?
I'm using PyQt4
and my String is not Python String but, PyQt4.QtCore.QString
I can do it like:
filename=my_path.split("/")[-1]
But I think separator is OS specific, also I can't use something like os.path.basename
because it only work for original python string, so what will be the best option to do it?