0

I am downloading a .doc file using python in windows. But the downloaded file is not in readable form.

import urllib
url = 'https://ums.lpu.in/assignments/Teacher/16920_CA3.doc'
data = urllib.urlopen(url)
with open('file1.doc','w') as f:    # wb also gives the same result
    f.write(data.read())

I am getting the file using this method but the file can't be read. I tried many ways but none of them seems to be working.

ksai
  • 987
  • 6
  • 18

0 Answers0