How to modify the name of a text file without modifying it's content in Python? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to modify the name of a text file without modifying it's content in Python?

Let's say my text file name is hello_123_date.txt. and I want to change it to hello_123_date_myname.txt. but I want to keep the content the same without modifying the content. How can I do that?

26th May 2020, 4:30 AM
Karzan
2 Answers
+ 1
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 Thanks the link you sent works for me.
26th May 2020, 6:23 AM
Karzan
0
Tom Joney (TheCoder) I know how to write to a file. I want to modify the title only. The link you sent me shows how to write to a file but that is not what I am looking for.
26th May 2020, 4:34 AM
Karzan