MCPcopy Index your code
hub / github.com/geekcomputers/Python / print_n_speak_index

Function print_n_speak_index

VoiceAssistant/Project_Basic_struct/textRead.py:276–290  ·  view source on GitHub ↗

Along with printing, it speaks out the index too. Args: toc (nested list): toc[1] - Topic name toc[2] - Page number

(toc)

Source from the content-addressed store, hash-verified

274
275
276def 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
293def search_in_toc(toc, key, totalpg):

Callers 1

pdf_readFunction · 0.85

Calls 1

speakFunction · 0.90

Tested by

no test coverage detected