[scribus] python script result

JLuc jluc at no-log.org
Wed Apr 21 13:59:11 UTC 2021


Le 21/04/2021 à 15:22, Gregory Pittman a écrit :

 > When I run ExtractText.py with a messageBox() to show the file saved to it shows me './pagecount.txt' to perhaps you 
should add that ./ at the beginning...

OK a rights access issue. I could fix it not with ./ but with the absolute path /DATA/etc/test/pagecount.txt
I guess the script's current directory is not the document's folder.

So the correct test scripts reads :
>>> #!/usr/bin/env python >>> # -*- coding: utf-8 -*->>> import scribus>>> pagenum = scribus.pageCount()>>> T=[]>>> T.append('pagecount=' + 
str(pagenum) + '\n\n')>>> output_file = open('/DATA/etc/test/pagecount.txt', 'w')>>> output_file.writelines(T)>>> 
output_file.close()
JLuc





More information about the scribus mailing list