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

Function print_index

VoiceAssistant/Project_Basic_struct/textRead.py:260–273  ·  view source on GitHub ↗

Prints out the index in proper format with title name and page number Args: toc (nested list): toc[1] - Topic name toc[2] - Page number

(toc)

Source from the content-addressed store, hash-verified

258
259
260def print_index(toc):
261 """Prints out the index in proper format with title name and page number
262
263 Args:
264 toc (nested list): toc[1] - Topic name
265 toc[2] - Page number
266 """
267 dash = "-" * (100 - 7)
268 space = " " * 47
269 print(f"{space}INDEX")
270 print(f"\n\nName : {dash} PageNo.\n\n\n")
271 for topic in toc:
272 eq_dash = "-" * (100 - len(topic[1]))
273 print(f"{topic[1]} {eq_dash} {topic[2]}")
274
275
276def print_n_speak_index(toc):

Callers 1

pdf_readFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected