Use os.rename
:
import os
os.rename('a.txt', 'b.kml')'
Usage:
os.rename('from.extension.whatever','to.another.extension')
More Related Contents:
- How to rename many files in many folders with python? [duplicate]
- Rename multiple files in a directory in Python [duplicate]
- Rename multiple files in Python [duplicate]
- Enforce unique upload file names using django?
- How on earth does this code work
- Create Pandas DataFrame from txt file with specific pattern
- How to get text with Selenium WebDriver in Python
- Compare two columns using pandas
- open() in Python does not create a file if it doesn’t exist
- From ND to 1D arrays
- reducing number of plot ticks
- Read and overwrite a file in Python
- How to dump a dict to a JSON file?
- Reason for “all” and “any” result on empty lists
- Is the += operator thread-safe in Python?
- How do I convert a Python list into a C array by using ctypes?
- Multiple value checks using ‘in’ operator (Python)
- Sorting a set of values
- np arrays being immutable – “assignment destination is read-only”
- View RDD contents in Python Spark?
- Is it possible to modify a variable in python that is in an outer (enclosing), but not global, scope?
- Converting images to csv file in python
- how to center image inside a rect pygame
- How do I raise the same Exception with a custom message in Python?
- Python list([]) and []
- How to enable a virtualenv in a systemd service unit?
- gcloud app deploy : This deployment has too many files
- Convert a column of timestamps into periods in pandas
- Upgrade Python to 2.6 on Mac
- Printing using list comprehension