Re: Rename files with numbers

2005-10-31 Thread Dudu Figueiredo
Micah, thanks a lot, nice script!
But its not completly working, i ran this:

fix_ugly_song_names('C:\My Shared Folder\Rubber Soul', 'The
Beatles', spacerepl=' ')

And the shell prints this:

01 drive my car.mp3 --> The Beatles - Drive My Car.mp3
02 norwegian wood (this bird has flo).mp3 --> The Beatles -
Norwegian Wood This Bird Has Flo.mp3
03 you won't see me.mp3 --> The Beatles - You Wont See Me.mp3
04 nowhere man.mp3 --> The Beatles - Nowhere Man.mp3
05 think for yourself.mp3 --> The Beatles - Think For Yourself.mp3
06 the word.mp3 --> The Beatles - The Word.mp3
07 michelle.mp3 --> The Beatles - Michelle.mp3
08 what goes on.mp3 --> The Beatles - What Goes On.mp3
09 girl.mp3 --> The Beatles - Girl.mp3
10 i'm looking through you.mp3 --> The Beatles - Im Looking Through
You.mp3
11 in my life.mp3 --> The Beatles - In My Life.mp3
12 wait.mp3 --> The Beatles - Wait.mp3
13 if i needed someone.mp3 --> The Beatles - If I Needed
Someone.mp3
14 run for your life.mp3 --> The Beatles - Run For Your Life.mp3

But the files didn't change in the folder!
Is there something mising or i'm doing something worng ??

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Rename files with numbers

2005-10-31 Thread Dudu Figueiredo
Oh, forget what i've just said, i didn't read the __debug__  part.
It worked perfectly =]
Realy good Python classes!

Eduardo Figueiredo
http://dudufigueiredo.com

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Rename files with numbers

2005-11-02 Thread Dudu Figueiredo
I wrote a simpler script based in Micah Elliott's help, it's to add the
band name to mp3 files imported with iTunes:

import glob, os

def renamer_itunes(songdir, band):
""" Rename mp3 files imported from itunes, transformation:
Song Name.mp3 --> Artists - Song Name.mp3
"""
os.chdir(songdir)
archives = glob.glob("*.mp3")
pretties = []
for ugly in archives:
song, ext = os.path.splitext(ugly)
song = song.title()
song = band + " - " + song
songext = song + ext
pretties.append(songext)
for ugly, pretty in zip(archives, pretties):
os.rename(ugly, pretty)

Just an exercise, I'm begining in Python now...
Thanks to every one that helped me, i'll bring more questions for you.
Sorry for my bad english, i'm Brazilian... !
_
Eduardo Figueireredo
http://dudufigueiredo.com

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Rename files with numbers

2005-11-17 Thread Dudu Figueiredo
thanks, i'll take a look ;]

-- 
http://mail.python.org/mailman/listinfo/python-list