Python program to renaming the file or directory

# X is the original name and Y is the name to be changed
import os, sys
print ("The dir is: %s"%os.listdir(os.getcwd()))
os.rename("X","Y")  
print ("Successfully renamed.")
print ("the dir is: %s" %os.listdir(os.getcwd()))

2 comments:

sumant kumar said...

best information for us.thank you.
Python 3 tutorial Python

Math and English Learning On-Line said...

Very Nice Presentation. Go ahead friend.