0

Python question

file = open("/storage/emulated/0/Documents/Dino sololearn.docx", "r") cont = file.read() print(cont) file.close()

13th Nov 2020, 5:47 PM
Dino Gupta
Dino Gupta - avatar
8 ответов
+ 2
That code is meant for text files. Docx is "a bit" more complex than that You could try this: https://www.google.de/search?q=JUMP_LINK__&&__python__&&__JUMP_LINK+docx
13th Nov 2020, 5:57 PM
Benjamin Jürgens
Benjamin Jürgens - avatar
+ 1
if you want to work with docx files you have to import docx , but it is easier to convert your file to txt , then file= open("Dino.txt", "r") for x in file: print(x)
13th Nov 2020, 6:53 PM
**🇦🇪|🇦🇪**
**🇦🇪|🇦🇪** - avatar
+ 1
I have use TXT but still not working
13th Nov 2020, 7:31 PM
Dino Gupta
Dino Gupta - avatar
+ 1
file= open(/"storage/emulated/0/dino sololearn.txt") for x in file: print(x)
13th Nov 2020, 7:32 PM
Dino Gupta
Dino Gupta - avatar
0
Can any body tell how i can print a microsoft word document i am using andriod
13th Nov 2020, 5:47 PM
Dino Gupta
Dino Gupta - avatar
0
So what are text files
13th Nov 2020, 5:58 PM
Dino Gupta
Dino Gupta - avatar
0
Text files are files that contain text. Sorry for the tautology. Common file endings are txt, xml, csv, html etc You can open them in a text editor. Docx is a container (zip file) with a certain structure
13th Nov 2020, 7:30 PM
Benjamin Jürgens
Benjamin Jürgens - avatar
0
Dino Gupta you forget to read the file "r" , in your reply you didn’t write it : file= open(/"storage/emulated/0/dino sololearn.txt", "r") for x in file: print(x)
14th Nov 2020, 9:37 PM
**🇦🇪|🇦🇪**
**🇦🇪|🇦🇪** - avatar