Blank lines when i write a txt from Dynamo

Hello everybody!. I have a simple problem, i’m using a python node with this code:

F = IN[0]
sust = IN[1]

f = open(F, “w”)
f.write(sust)
f.close()

OUT = f

But when the txt is created, it appears a blank line for each line in the text that i want to write in the txt.

example:
text i want to write:
Hello everybody
this it the example
.
result:
Hello everybody

  this it the example

  .

I have the same problem, but there is a simple solution. You can replace the blank lines with nothing, thus removing them:

F = IN[0]
sust = IN[1]

#Replace Blank lines with nothing, thus removing them
sust = sust.replace("\n","")

f = open(F, "w")
f.write(sust)
f.close()

OUT = F

Thanks so much! thats exactly the solution that i needed.