Make file.append int to string more pythonic