image.py 391 B

12345678910111213141516
  1. #!/usr/bin/env python
  2. # -*- coding: windows-1251 -*-
  3. # Copyright (C) 2005 Kiseliov Roman
  4. from xlwt import *
  5. w = Workbook()
  6. ws = w.add_sheet('Image')
  7. ws.insert_bitmap('python.bmp', 2, 2)
  8. # Also works if you already have the image bitmap data in memory...
  9. with open ("python.bmp", "r") as bmpfile:
  10. bmpdata = bmpfile.read()
  11. ws.insert_bitmap_data(bmpdata, 10, 2)
  12. w.save('image.xls')