File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change 11"""Example of creating tables from Polars dataframe."""
22
3- import sys
43from pathlib import Path
54
65import tppt
76from tppt .types import Color
87
98# Flag to determine whether to use Polars
10- USE_POLARS = True
119EXAMPLE_DIR = Path (__file__ ).parent
1210
1311
1412def main ():
1513 """Run the sample."""
16- import polars as pl
14+ import polars as pl # type: ignore
1715
1816 # Create dataframe with Polars
1917 df = pl .DataFrame (
@@ -80,10 +78,17 @@ def main():
8078
8179
8280if __name__ == "__main__" :
81+ from tppt ._features import USE_POLARS
82+
8383 if USE_POLARS :
8484 main ()
8585 else :
86- print (
87- "Polars is not installed. Please install it to run this example." ,
88- file = sys .stderr ,
89- )
86+ tppt .Presentation .builder ().slide (
87+ tppt .SlideBuilder ().text (
88+ "Polars is not installed. Please install it to run this example." ,
89+ left = (50 , "pt" ),
90+ top = (50 , "pt" ),
91+ width = (500 , "pt" ),
92+ height = (50 , "pt" ),
93+ )
94+ ).build ().save (EXAMPLE_DIR / "dataflame_table.pptx" )
You can’t perform that action at this time.
0 commit comments