Python tip, list contents of directory

Python: list contents of a directory, remove an extension from the file names.

import os
dirList=os.listdir('path')
for fname in dirList:
    print fname.replace('.ext','')