reading formatted text using python,g.write('# comment\n')