hlep: a text search and rename question

Steve Holden steve at holdenweb.com
Tue Jan 13 01:33:09 CET 2009

sensen wrote:
> On Jan 12, 10:41 pm, sensen <Zhangfang.... at gmail.com> wrote:
>> both above works well, but a problem is renamed file is without
>> filename extension.
>> only change to the title.
>> for example, the origin file is track_1.flac, after run the script i
>> want it to for example, White Flag.flac, but now it change to White
>> Flag without extension.
>> could you do a favor to fix it. thank you.
> fixed it, i check the reference of python.
> the last line  from
>            os.rename(old, new)
> changed to
>            os.rename(old, new+'.flac')
> thanks, now i still try to read the reference of python.
> i want to the script can know what file it will open. in other words,
> the script maybe first do a search, and get the exactly file name of
> the cue type file in the folder, then open it.

Well done - the true Python spirit. Fix it yourself when you can. And
now you know a bit more about the logic James so kindly wrote for you.
Congratulations, and welcome to the Python community.


Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/

More information about the Python-list mailing list