Along with printing, it speaks out the index too. Args: toc (nested list): toc[1] - Topic name toc[2] - Page number
(toc)
| 274 | |
| 275 | |
| 276 | def print_n_speak_index(toc): |
| 277 | """Along with printing, it speaks out the index too. |
| 278 | |
| 279 | Args: |
| 280 | toc (nested list): toc[1] - Topic name |
| 281 | toc[2] - Page number |
| 282 | """ |
| 283 | dash = "-" * (100 - 7) |
| 284 | space = " " * 47 |
| 285 | print(f"{space}INDEX") |
| 286 | print(f"\n\nName : {dash} PageNo.\n\n\n\n") |
| 287 | for topic in toc: |
| 288 | eq_dash = "-" * (100 - len(topic[1])) |
| 289 | print(f"{topic[1]} {eq_dash} {topic[2]}") |
| 290 | speak(f"{topic[1]} {topic[2]}") |
| 291 | |
| 292 | |
| 293 | def search_in_toc(toc, key, totalpg): |