Pythonを使用してファイルの名前を変更する方法 質問する

Pythonを使用してファイルの名前を変更する方法 質問する

a.txtに変更したいですb.kml

ベストアンサー1

使用os.rename:

import os

os.rename('a.txt', 'b.kml')

使用法:

os.rename('from.extension.whatever','to.another.extension')

おすすめ記事