How to use str for file lines in Python?

0

When reading the lines of the file, some characters are always read as last characters, some white characters as spaces and the line change character ('\ n'). This causes the created file names to include these additional characters. For example here:

archivo_usuario = open(nombre+".user","w")
archivo_usuario.write(nombre+"\n")

What methods of str can I use so that the last empty spaces or line break ('\ n') are not read?

    
asked by José Ignacio 01.03.2018 в 17:06
source

0 answers