hlep: a text search and rename question

sensen Zhangfang.hit at gmail.com
Mon Jan 12 15:52:20 CET 2009


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.



More information about the Python-list mailing list