diff options
| author | Kenneth Reitz <me@kennethreitz.com> | 2010-08-28 17:14:39 -0400 |
|---|---|---|
| committer | Kenneth Reitz <me@kennethreitz.com> | 2010-08-28 17:14:39 -0400 |
| commit | b6419d79183dad0965c8574757e333a87761a2fb (patch) | |
| tree | 421e59676715e42e5f6fd7e81f43d312351f81d4 /tablib/packages/xlwt/examples/unicode0.py | |
| parent | de8ed8dd03f5417e210a7dcd29e694c5b4bfa29e (diff) | |
| download | tablib-b6419d79183dad0965c8574757e333a87761a2fb.tar.gz | |
module name refactorization
Diffstat (limited to 'tablib/packages/xlwt/examples/unicode0.py')
| -rw-r--r-- | tablib/packages/xlwt/examples/unicode0.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tablib/packages/xlwt/examples/unicode0.py b/tablib/packages/xlwt/examples/unicode0.py new file mode 100644 index 0000000..0f62a61 --- /dev/null +++ b/tablib/packages/xlwt/examples/unicode0.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python
+import xlwt
+
+# Strings passed to (for example) Worksheet.write can be unicode objects,
+# or str (8-bit) objects, which are then decoded into unicode.
+# The encoding to be used defaults to 'ascii'. This can be overridden
+# when the Workbook instance is created:
+
+book = xlwt.Workbook(encoding='cp1251')
+sheet = book.add_sheet('cp1251-demo')
+sheet.write(0, 0, '\xce\xeb\xff')
+book.save('unicode0.xls')
|
