import markdown with open('main.md', 'r', encoding='utf-8') as fr: with open('main.html', 'w', encoding='utf-8') as fw: fw.write('\ \ \ \ \ \ \ ') fw.write(markdown.markdown( fr.read(), output_format='html5', extensions = [ 'markdown.extensions.admonition', 'markdown.extensions.tables' ])) fw.write('\ ') print('OK!')