Is it possible to use the python command rstrip so that it does only remove one exact string and does not take all letters separately?
I was confused w
This will work regardless of extension type.
# Find the rightmost period character
filename = "my file 1234.txt"
file_extension_position = filename.rindex(".")
# Substring the filename from first char up until the final period position
stripped_filename = filename[0:file_extension_position]
print("Stripped Filename: {}".format(stripped_filename))