Re: [Tutor] Converting Filenames to Lower case
"Richard Querin" <[EMAIL PROTECTED]> wrote > Any ideas on where to look? I've fiddled quite a bit with very basic > scripting but nothing to do with getting files from the current > directory > and processing their names. Can anybody point me in the right > direction to > get started? Kent gave you the immediate amswers. You might also like to read through my tutorial topic on Working with the OS. It covers several other things to do with handling files, folders and processes etc. -- Alan Gauld Author of the Learn to Program web site http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Converting Filenames to Lower case
Richard Querin wrote: > Hi, I'm interested in a writing a quick python script for use on the > command line. I'm at the linux terminal inside a directory with a bunch > of files. The files have mixed case (some are .JPG and some are .jpg, > etc..) I'd like to be able to run a python script that will take all the > files in the directory I'm in and convert all the filenames and > extensions to lower case. > > Any ideas on where to look? I've fiddled quite a bit with very basic > scripting but nothing to do with getting files from the current > directory and processing their names. Can anybody point me in the right > direction to get started? os.listdir() will list the current dir. os.rename() will rename a file. filename.lower() converts to lower case. Kent ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Converting Filenames to Lower case
Hi, I'm interested in a writing a quick python script for use on the command line. I'm at the linux terminal inside a directory with a bunch of files. The files have mixed case (some are .JPG and some are .jpg, etc..) I'd like to be able to run a python script that will take all the files in the directory I'm in and convert all the filenames and extensions to lower case. Any ideas on where to look? I've fiddled quite a bit with very basic scripting but nothing to do with getting files from the current directory and processing their names. Can anybody point me in the right direction to get started? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor