I have a file which has only + and - in 1 line and there are multiple lines. So basically file is as below.
-++++
+----
+++++
and I have a script which does health check of some websites and extending these lines. So, every line above means another website from a list. (e.g: ["example.com", "google.com", "test.com"]
My script runs every 5minutes and everytime it runs I am adding plus or minus depends on website's availability.
I tried somethings like using readlines
method but it returns me ['-++++\n', '+----\n', '+++++\n']
.
I am a bit stuck with overriding same file with new value both because I don't know what's best way and because of these new lines characters in the returned list from readlines method.
What would be your suggestion for solving this issue?