I need to import data of excel .xls file directly through Glyphs macro.
And found that the python project xlrd can Extract data from Excel spreadsheets.
Below is the URL:
It worked in python CMD but can’t call it through Glyphs Micro.
How to call or use it through Glyphs Micro?
My script as below:
# my xlrd script
import xlrd
data = xlrd.open_workbook('file/demo.xlsx')
table = data.sheet_by_name('sheet1')
but it can’t work.
Please help , thanks a lot.
Please enclose Python code in triple backticks (```), I did that for your post now.
I have no experience with xlrd. But you can more easily parse plain-text CSVs. You will see examples in the mekkablue scripts.
Make sure you install it in a place where the python in Glyphs can find it.
In the macro panel, run this code:
import sys
print("\n".join(sys.path))
Pick one path from the list and install xlrd
there.
I’ve just solve it through let the setting in Preferences > User Settings > Use system console for script output be set.
But I don’t know the reason why it’s solved.
That can’t be it. But maybe you needed to restart Glyphs?