0

Today I'm trying to open a file created by a python program, and modify it with some values asked by the user during the execution of the program. The text file here is defined by "Compression" The text I want to replace is "IND1\n" Here's what I did :

Code_Image

The program runs without error, it launches and creates the file for me, but does not perform this step... The file still contains "IND1\n" at the end of the execution. Would you have an idea ?

Thanks in advance ! Regards, Sneeax

Sneeax
  • 1
  • Welcome to SO. Please post code as formatted text, not as an image. You are currently only modifying the string in memory - you need to write your modified string back to your file. Related: [How to open a file for both reading and writing](https://stackoverflow.com/questions/6648493/how-to-open-a-file-for-both-reading-and-writing) – Mike Scotty Apr 28 '22 at 08:19

0 Answers0