If you are using os rename src dest…

If you are using
outside the current working directory, you can’t simply use
os.rename(filename, “output.mp3”)
since it will move the file to the current working directory. You should rather,
to get the file’s directory and then rename the file. For example you can use
`os.rename(file_name, os.path.dirname(file_name) + ‘/{song_title}.mp3’.format(song_title=song_title))`

Leave a Reply

Scroll to Top