when save game is loaded, an ugly \n appears at the end of string variables

Started by
0 comments, last by ultramailman 11 years, 1 month ago

Not so much of a technical problem as a cosmetic problem, but when loading from game generated save files, a ugly \n for the breaks between lines appear in string variables.

For example:

filen.write(name)#your name
filen.write("\n")
the above results in in this in the console window:
Dryad Berserker\n
for example, the classes are variable
what i want to know is if or how i can remove this
thank you for your time
Advertisement

You can remove the line

filen.write("\n")

or you can use the strip method on the string,

or you can just write your game save loader in such a way that it will decide which newlines should be ignored.

That's all I can think of now.

This topic is closed to new replies.

Advertisement