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

Function ms_word

VoiceAssistant/Project_Basic_struct/textRead.py:11–35  ·  view source on GitHub ↗

[Print and speak out a ms_word docx file as specified in the path]

()

Source from the content-addressed store, hash-verified

9
10
11def ms_word():
12 """[Print and speak out a ms_word docx file as specified in the path]"""
13 # TODO : Take location input from the user
14 try:
15 speak("Enter the document's location - ")
16 location = input("Enter the document's location - ")
17
18 file_loc = doubleslash(location)
19
20 doc = docx.Document(file_loc)
21 fullText = []
22 for para in doc.paragraphs:
23 fullText.append(para.text)
24 # print(fullText)
25 doc_file = "\n".join(fullText)
26 print(doc_file)
27 speak(doc_file)
28 except Exception as exp:
29 # print(exp)
30 print(f"ERROR - {exp}")
31 print(
32 Fore.YELLOW
33 + "I could'nt locate the file!\nIf you didn't specify the extension of the file, please specify it."
34 )
35 return "None"
36
37
38def pdf_read():

Callers 1

mainFunction · 0.85

Calls 3

speakFunction · 0.90
doubleslashFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected