File tree Expand file tree Collapse file tree 2 files changed +586
-588
lines changed Expand file tree Collapse file tree 2 files changed +586
-588
lines changed Original file line number Diff line number Diff line change 22
33from pathlib import Path
44
5- from pptx .enum .shapes import MSO_AUTO_SHAPE_TYPE
6- from pptx .util import Inches
7-
85import tppt
6+ from pptx .enum .shapes import MSO_AUTO_SHAPE_TYPE
97
108
119def main ():
@@ -19,32 +17,32 @@ def main():
1917 shape .fill .solid ().fore_color .set_rgb ("#0066ff" ),
2018 shape .set_text ("Sample Box with Text" ),
2119 )[- 1 ],
22- left = Inches ( 1 ),
23- top = Inches ( 1 ),
24- width = Inches ( 4 ),
25- height = Inches ( 2 ),
20+ left = ( 1 , "in" ),
21+ top = ( 1 , "in" ),
22+ width = ( 4 , "in" ),
23+ height = ( 2 , "in" ),
2624 )
2725 .add_shape (
2826 MSO_AUTO_SHAPE_TYPE .ROUNDED_RECTANGLE ,
2927 lambda shape : (
3028 shape .fill .solid ().fore_color .set_rgb ("#ff6600" ),
3129 shape .set_text ("Rounded Box" ),
3230 )[- 1 ],
33- left = Inches ( 6 ),
34- top = Inches ( 1 ),
35- width = Inches ( 3 ),
36- height = Inches (1.5 ),
31+ left = ( 6 , "in" ),
32+ top = ( 1 , "in" ),
33+ width = ( 3 , "in" ),
34+ height = (1.5 , "in" ),
3735 )
3836 .add_shape (
3937 MSO_AUTO_SHAPE_TYPE .OVAL ,
4038 lambda shape : (
4139 shape .fill .solid ().fore_color .set_rgb ("#00ff00" ),
4240 shape .set_text ("Circle" ),
4341 )[- 1 ],
44- left = Inches ( 1 ),
45- top = Inches ( 4 ),
46- width = Inches ( 2 ),
47- height = Inches ( 2 ),
42+ left = ( 1 , "in" ),
43+ top = ( 4 , "in" ),
44+ width = ( 2 , "in" ),
45+ height = ( 2 , "in" ),
4846 )
4947 ).save (Path (__file__ ).with_suffix (".pptx" ))
5048
You can’t perform that action at this time.
0 commit comments