Script to rename all filenames in a directory to use ALL CAPITAL LETTERS

Stephen P Rufle stephen.p.rufle at cox.net
Tue Apr 7 13:40:26 MST 2009


This is how I was doing it before I saw the one liner

<snip>
#!/usr/local/bin/python
# ren_to_upper.py
import os

for fname in os.listdir(os.getcwd()):
    newfname = fname.upper()
    os.rename(fname, newfname)
</snip>


More information about the PLUG-discuss mailing list