I want to change a.txt
to b.kml
.
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
os.rename(old, new)
This is found in the Python docs: http://docs.python.org/library/os.html
Use
os.rename
:File may be inside a directory, in that case specify the path:
Use
os.rename
. But you have to pass full path of both files to the function. If I have a filea.txt
on my desktop so I will do and also I have to give full of renamed file too.this should do it. python 3+