def get_filename(path): return path[:path.rfind('.')]
Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/URHkW9c3tZE/13279