How to rename a file using Python

Use os.rename:

import os

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

Leave a Comment