[reportlab-users] platypus and xml.py

Jairo Souto jsouto at gmx.com
Tue Sep 25 09:25:19 EDT 2018


a script xml.py in the working directory is run when importing platypus.
is it ok? why?

===== xml.py :

from dlg import spgsql
from lxml import etree

pkey = 59

db = spgsql.database(dbname = "controle")

r = db.record("fis.nfe_xmls",pkey = pkey)
if not r.unique():
	db.error("pkey nao encontrado: {}",pkey)

infNFe = etree.fromstring(r.doc).find("{*}NFe/{*}infNFe")
print(infNFe)
emitente = infNFe.findtext("./{*}emit/{*}xNome")
print(emitente)

=====

===== typescript

Script started on Tue Sep 25 10:16:19 2018
urano$ python3.6
Python 3.6.3 (default, Oct 13 2017, 23:01:18)
[GCC 4.2.1 20070719 ] on openbsd5
Type "help", "copyright", "credits" or "license" for more information.
>>> from reportlab import platypus
<Element {http://www.portalfiscal.inf.br/nfe}infNFe at 0x7f1bf9b7548>
AUTO PECAS NELSINHO LTDA
>>> 
urano$ ^D

Script done on Tue Sep 25 10:17:05 2018

=====

--Jairo Souto 



More information about the reportlab-users mailing list