[Scribus] Help Introducing Text from a python Script

Petr Vaněk petr
Thu Oct 28 22:38:31 CEST 2004


On Thursday 28 of October 2004 18:25, Luis Hurtiz wrote:
...
> primera = CreateText(.5, 4.5, 7.25, 6)
> texto = open('/home/luis/textos/primera85.txt', 'r')
> while 1:
>       lineas = texto.readline(100000)
>       if not lineas:
>               break
>       posicion = GetTextLength(primera)
>       InsertText(lineas, posicion, primera)
...
> Exception: Oook ! Wrong arguments! Call:
> InsertText(unicodetext, position [, objectname])

that's because of various encoding of the text. You will be enforced to know 
the encoding of your file (to process) and then use e.g.:
InsertText(unicode(lineas, 'iso-8859-2'), posicion, primera)

-- 
Petr Vanek --------------
petr [at] yarpen [dot] cz
www.yarpen.cz ----------------
Kuolema Kaikille (Paitsi Meille)
-------------------------------
Today is good day to end it all
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://nashi.altmuehlnet.de/pipermail/scribus/attachments/20041028/decfa471/attachment.pgp 



More information about the scribus mailing list