Re: Script to rename all filenames in a directory to use ALL…

Góra strony
Załączniki:
Wiadomość jako email
+ (text/plain)
Delete this message
Reply to this message
Autor: Stephen P Rufle
Data:  
Dla: Main PLUG discussion list
Temat: Re: Script to rename all filenames in a directory to use ALL CAPITAL LETTERS
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>
---------------------------------------------------
PLUG-discuss mailing list - 
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss