Closed legendxcheng closed 9 years ago
No unicode is unfortunately a deal-breaker =/
Otherwise looks very promising.
unicode is supported but you may you have to declare the encoding at the top of your source file. Also make sure that the string is marked as unicode by prepending a u
on Python 2:
# -*- coding:utf-8 -*-
from xlpython import xlfunc
@xlfunc
def unicode_test():
return u'öü'
Called from Excel, this will work correctly. Note that often, you will want to declare the encoding while reading in some data. For example when reading in a csv file:
import csv
with open('some.csv', newline='', encoding='utf-8') as f:
reader = csv.reader(f)
for row in reader:
print(row)
Using pandas, this would look something like this:
df = pd.read_csv('some.csv', encoding='utf-8')
I tried to use ExcelPython in a xlsm file containing Asian Characters, it didn't work. ExcelPython is a very promising tool for people play with numbers, good job!