>>> print(os.path.splitext(os.path.basename("hemanth.txt"))[0])
hemanth
↧
Answer by hemanth.hm for How to get the filename without the extension from a path in Python?
↧
>>> print(os.path.splitext(os.path.basename("hemanth.txt"))[0])
hemanth