Skip to content

Instantly share code, notes, and snippets.

@JosiasAurel
Created December 28, 2019 09:41
Show Gist options
  • Save JosiasAurel/73549dad7946c07ee7c357ddd1cb9272 to your computer and use it in GitHub Desktop.
Save JosiasAurel/73549dad7946c07ee7c357ddd1cb9272 to your computer and use it in GitHub Desktop.
import mammoth
path_to_file = input("")
f = open(path_to_file, 'rb')
b = open('converted.html', 'wb')
document = mammoth.convert_to_html(f)
b.write(document.value.encode('utf8'))
f.close()
b.close()
'''instructions :
//change "your_file_name" to
//the file to be converted
// with *.docx extension
//place program in the
// directory containing your
// *.docx file and run it
// the output file is an html
// file
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment