How do I remove a trailing newline?

Try the method rstrip() (see doc Python 2 and Python 3) >>> ‘test string\n’.rstrip() ‘test string’ Python’s rstrip() method strips all kinds of trailing whitespace by default, not just one newline as Perl does with chomp. >>> ‘test string \n \r\n\n\r \n\n’.rstrip() ‘test string’ To strip only newlines: >>> ‘test string \n \r\n\n\r \n\n’.rstrip(‘\n’) ‘test … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)