There are a number of ways to do this in Python. One approach is to use "splitext" instead of "basename":
filename, extension = os.path.splitext(savecases)
or if you're only interested in the file name and not the extension...
filename = os.path.splitext(savecases)[0]