LEZIONE 1..
PYTHON AVANZATO
libreria
REPORTLAB
Riepilogo lezione precedente
Pyplot
.figure
.plot
SET
GET
.xaxis
.yaxis
.get_major_ticks
.set_label_text
.set_xlabel
.add_subplot
Reportlab
Reportlab Ăš un programma per la creazione di documenti pdf
con python.
Un documento puĂČ essere visto come la composizione di
contenuti scritti all'interno di uno spazio.
Un programma per la creazione di documenti deve gestire due
macro aree:
a) come posizionare i vari contenuti all’interno dello spazio;
b) quale aspetto dare ai diversi contenuti;
Posizione per
riferimento logico:
titolo, header, footer,
capoverso, ecc.
ad esempio word o
writer
Posizione fisica,
definendo le
coordinate all’interno
di un sistema
cartesiano
ad esempio
matplotlib
Come posizionare i vari contenuti all’interno di uno spazio
Posizionamento
logico
Posizionamento
cartesiano
classe
Canvas
libreria
platiplus
classe
Flowable
LEZIONE 1..
www.fordatascientist.org
N00-ReportLab
N01-Introduction.ipynb
.Canvas
.drawString
.line
.pagesize
letter A4 A5
.circle
Posizionamento Logico: gestione contenuti
Template A
pagesize[0]
pagesize[1]
SimpleDocTemplate
Area
conte-
nuti .build
[
]
Paragraph 1
Paragraph 2
Spazio
Paragraph 3
Image 1
Spazio
Paragraph 4







.
Spazio
Paragraph n
Spazio
Table 1
Spazio
Table 2
Paragraph
Image
Spacer
Table
Template A
Paragraph 1
Paragraph 2
Spazio
Paragraph 3
Template A
Image 1
Spazio
Paragraph 4
Template A
Spazio
Paragraph n
Spazio
Table 1
Template A
Spazio
Table 2
LEZIONE 1..
www.fordatascientist.org
N00-ReportLab
N03-SimpleDocument.ipynb
.getSampleStyleSheet
.Paragraph(‘contenuto’,stile)
configurazione stili
.Image(file)
.Table([[..],[..]])
.build
LEZIONE 1..
www.fordatascientist.org
N00-ReportLab
N05-SimpleDocumentTemplate.ipynb
.onFirstPage
.def
. (.Canvas, SimpleDocTemplate
SimpleDocTemplate)
.build
.onLaterPages
[..contenuti....]
Gestione template e contenuti personalizzati
Template tramite
funzioni
def
..(Canvas,
SipleDocTemplate)
Contenuti
personalizzati tramite
classe derivata da
Flowable, definendo
def __init__
def __repr__
def draw
LEZIONE 1..
www.fordatascientist.org
N00-ReportLab
N30-CustomFlowables.ipynb
Tabelle
1
3
0
0 1
2
2 3
-1
-1-2
(1,0),(3,2)
(0,-2),(-1,-1)
TableStyle
'ALIGN'
'VALIGN'
'TEXTCOLOR’
'INNERGRID'
‘LINEAFTER’
‘LINEBELOW’.
‘LINEABOVE’
LEZIONE 1..
www.fordatascientist.org
N00-ReportLab
N08-Table.ipynb
Stili standard stili personalizzati
Parent
NewStyle
Attributi
ParagraphStyle
getSampleStyleSheet
‘Normal’
‘Bullet’
‘Italic’
‘Title’
ParagraphStyle
.defaults
LEZIONE 1..
www.fordatascientist.org
N00-ReportLab
N09-Style.ipynb
CONTATTI TELEFONO
051 22 35 20
EMAIL
WORKSHOP@VICEM.IT

More Related Content

PPTX
Business model-forecast
PPTX
ZakoƄczenie klas 3
 
PPTX
PoĆŒegnanie klas III 2016
 
DOC
Haitham Moukhtar CV.....
PDF
Sales ICM
PPTX
BitRush Investors Deck Update Oct 2015
PDF
us-fsi-private-equity-growth-in-transition
PPTX
Eriksson.Jonatan
Business model-forecast
ZakoƄczenie klas 3
 
PoĆŒegnanie klas III 2016
 
Haitham Moukhtar CV.....
Sales ICM
BitRush Investors Deck Update Oct 2015
us-fsi-private-equity-growth-in-transition
Eriksson.Jonatan

Viewers also liked (16)

PDF
Urunkatalogu
DOCX
Senior marketing executive perfomance appraisal 2
DOCX
Accounting executive perfomance appraisal 2
PPTX
Quantum Computers Presentation
PDF
us-fsi-closer-look-business-development-companies-041715 (1)
PDF
us-fsi-positioning-for-success-in-private-equity
PDF
Professional Persona Project: Visual Resume
PPTX
BitRush Investors Deck Nov 2015
DOCX
Clinical project manager perfomance appraisal 2
PPTX
Evaluation Question 3
PPTX
IPS bab dokumen keles 2 mi/sd semester 1
PDF
Untitled Presentation
PDF
gx-fsi-2015-mutual-fund-outlook-010714
PDF
abstract_tesi
PPTX
Katha23
PPTX
BitRush Corp Update
Urunkatalogu
Senior marketing executive perfomance appraisal 2
Accounting executive perfomance appraisal 2
Quantum Computers Presentation
us-fsi-closer-look-business-development-companies-041715 (1)
us-fsi-positioning-for-success-in-private-equity
Professional Persona Project: Visual Resume
BitRush Investors Deck Nov 2015
Clinical project manager perfomance appraisal 2
Evaluation Question 3
IPS bab dokumen keles 2 mi/sd semester 1
Untitled Presentation
gx-fsi-2015-mutual-fund-outlook-010714
abstract_tesi
Katha23
BitRush Corp Update
Ad

More from Annalisa Vignoli (18)

PDF
Presentazione Corsi FDS
PDF
Python base lezione 5
PDF
Python base lezione 4
PDF
Python base lezione 3
PDF
Python base lezione 2
PDF
Python base lezione1
PDF
Web base - Javascript (Node.js): Elementi di base
PDF
Web base - SVG
PDF
Web base - CSS e selettori
PDF
Web base - HTML
PDF
WEB BASE - Una visione d'insieme delle tecnologie web
PPTX
Presentazione Ulisse - Rame
PPTX
Presentazione Ulisse - Acciaio
PDF
Fordatascientist - Tecnologie Web base
PDF
ForDataScientist - Python matplotlib
PDF
ForDataScientist - Python advanced data
PDF
ForDataScientist - Python base parte2
PDF
ForDataScientist - Python base parte1
Presentazione Corsi FDS
Python base lezione 5
Python base lezione 4
Python base lezione 3
Python base lezione 2
Python base lezione1
Web base - Javascript (Node.js): Elementi di base
Web base - SVG
Web base - CSS e selettori
Web base - HTML
WEB BASE - Una visione d'insieme delle tecnologie web
Presentazione Ulisse - Rame
Presentazione Ulisse - Acciaio
Fordatascientist - Tecnologie Web base
ForDataScientist - Python matplotlib
ForDataScientist - Python advanced data
ForDataScientist - Python base parte2
ForDataScientist - Python base parte1
Ad

Fordascientist - Python reportlab