File: image.py

package info (click to toggle)
xlwt 1.3.0-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,036 kB
  • sloc: python: 8,615; makefile: 135
file content (16 lines) | stat: -rw-r--r-- 391 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env python
# -*- coding: windows-1251 -*-
# Copyright (C) 2005 Kiseliov Roman

from xlwt import *

w = Workbook()
ws = w.add_sheet('Image')
ws.insert_bitmap('python.bmp', 2, 2)

# Also works if you already have the image bitmap data in memory...
with open ("python.bmp", "r") as bmpfile:
    bmpdata = bmpfile.read()
    ws.insert_bitmap_data(bmpdata, 10, 2)

w.save('image.xls')