import osoldFileName = "test.txt"newFileName = "test.old"#Old Listingfor file in os.listdir("c:/"): if file.startswith("output"): print file#Remove file if the new name already existsif os.access(newFileName, os.X_OK): print "Removing " + newFileName os.remove(newFileName)#Rename the fileos.rename(oldFileName, newFileName)#New Listingfor file in os.listdir("c:/"): if file.startswith("output"): print file
Name (required)
email (will not be published) (required)
Website