hyperlinks.py 703 B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/env python
  2. # -*- coding: windows-1251 -*-
  3. # Copyright (C) 2005 Kiseliov Roman
  4. from xlwt import *
  5. f = Font()
  6. f.height = 20*72
  7. f.name = 'Verdana'
  8. f.bold = True
  9. f.underline = Font.UNDERLINE_DOUBLE
  10. f.colour_index = 4
  11. h_style = XFStyle()
  12. h_style.font = f
  13. w = Workbook()
  14. ws = w.add_sheet('F')
  15. ##############
  16. ## NOTE: parameters are separated by semicolon!!!
  17. ##############
  18. n = "HYPERLINK"
  19. ws.write_merge(1, 1, 1, 10, Formula(n + '("https://www.irs.gov/pub/irs-pdf/f1000.pdf";"f1000.pdf")'), h_style)
  20. ws.write_merge(2, 2, 2, 25, Formula(n + '("mailto:roman.kiseliov@gmail.com?subject=pyExcelerator-feedback&Body=Hello,%20Roman!";"pyExcelerator-feedback")'), h_style)
  21. w.save("hyperlinks.xls")