unicode2.py 656 B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/env python
  2. # -*- coding: windows-1251 -*-
  3. # Copyright (C) 2005 Kiseliov Roman
  4. from xlwt import *
  5. from xlwt.compat import PY3
  6. w = Workbook()
  7. ws1 = w.add_sheet(u'\N{GREEK SMALL LETTER ALPHA}\N{GREEK SMALL LETTER BETA}\N{GREEK SMALL LETTER GAMMA}\u2665\u041e\u041b\u042f\u2665')
  8. fnt = Font()
  9. fnt.height = 26*20
  10. style = XFStyle()
  11. style.font = fnt
  12. unichr = chr if PY3 else unichr
  13. for i in range(0xD800):
  14. ws1.write(i//0x10, i%0x10, unichr(i), style)
  15. for i in range(0xD800, 0xE000):
  16. ws1.write(i//0x10, i%0x10, "Surrogate", style)
  17. for i in range(0xE000, 0x10000):
  18. ws1.write(i//0x10, i%0x10, unichr(i), style)
  19. w.save('unicode2.xls')