I have a problem with deleting extension from my filename. I tried to use
os.path.splitext(checked_delivery)[0]
, but it delete only .gz
from filename. I need to check if file has extension or it's a directory. I did it using this:
os.path.exists(delivery)
But another problem is, that I can't split it cause of data in it (YYYY.MM.DD). Should I use join()
or it is something more attractive instead of tons of methods and ifs?