I want to change a.txt to b.kml.
a.txt
b.kml
You can use os.system to invoke terminal to accomplish the task:
os.system('mv oldfile newfile')