First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!
1 | initial version |
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]