''' Created on Feb 7, 2019 @author: Brett Paufler Copyright Brett Paufler Tester Output for Standard UTF Chess Pieces ''' #This is IMPORTANT for UTF #UTF is an error if printed to screen import codecs with codecs.open('./output/chess_pieces_utf_output.txt', 'w', 'utf-8') as t: #File Header Information t.write('utf_code: error in Python or HTML\n') t.write('ascii_string: literal for preceding utf-code\n') t.write('html_code: as needed for webpage\n') t.write('\n') t.write('utf\t\tascii\t\thtml\n') t.write('\n') for char in '456789ABCDEF': ascii_string = "u'\\u265%s'" % char utf_code = eval(ascii_string) html_code = 'ɥ%s;' % char #This elicits an error #Must write to file #print(utf_code) t.write(utf_code) t.write('\t\t') t.write(ascii_string) t.write('\t') t.write(html_code) t.write('\n') t.write('\n') t.write('NOTE on the UTF Symbols\n') t.write('\tNotepad++\t-\tNo on the Copy/Paste\n') t.write('\tInkscape\t-\tYES on the Copy/Paste\n') t.write('\tLibreOffice\t-\tYES on the Copy/Paste') print('Successful Termination') print('Look at ./output/chess_pieces_test.txt')