[scribus] Python scripting issue with ImageWriter - "NoneType object is not callable" error
wtxnh-scribus at yahoo.com.au
Fri Apr 1 07:00:51 UTC 2016
On Fri, Apr 01, 2016 at 02:10:19AM +0200, Andrea Marcon wrote:
> I managed to get what I need from Python directly, using pyBarcode
> (actually I've used a fork - viivakoodi
> <https://pypi.python.org/pypi/viivakoodi>), saving the barcode images and
> then importing them in Scribus by means of another script.
>From website i learned that viivakoodi depends on PIL to write png
I created simple script from example provided by viivakoodi :
from barcode.writer import ImageWriter
ean = barcode.get('ean13', '123456789102', writer = ImageWriter())
filename = ean.save('ean13')
When i run this script from scribus as:
scribus-1.5.2.svn -g -py bar.py
i do find ean13.png file created.
This script also produce desired png if I run scrip from scribus using
GUI menu (Scripter -> Execute Script ...)
It is hard to guess why you have your problem. Next time try to include
info about OS you are running on, python version, scribus version etc...
If you are on Windows platform, it might be that python you run your
script manualy, and the one you run from scribus is not the same and
later one can not find PIL library. I would restrain myself from further
guessing about environment you run your programs on.
More information about the scribus