from pathlib import Path
file = Path(r"C:\Users\SerT\Desktop\a.txt")
print (file.name)
file.rename(file.with_name("b.txt"))
print (file.name)
i'd like to know why file.name prints out "a.txt" in both instances even though the file actually gets renamed in windows explorer