python os filename without extension code example Example: python os filename without extension os.path.splitext('filename.txt')[0] # filename