How to get the filename without the extension from a path in Python?
I found out a method called
Getting the name of the file without the extension :
import os print os.path.splitext("path_to_file")
As for your import problem, you solve it this way :
from os.path import basename # now you can call it directly with basename print basename("/a/b/c.txt")