I am trying to use Markdown with python, but I am having trouble:
import markdown
layers = [1,2,3]
lr = 2
dir = 'result'
with open('readme.md', 'a+') as f:
f.write('## Layer sizes')
for layer in layers:
f.write('* {}'.format(layer))
f.write('## Learning rate is {}'.format(lr))
f.write('## Init')
f.write('Add note about init')
markdown.markdownFromFile(input=f, output=dir+'/out.html')
I get the error can't concat str to bytes which is a common question, for example here. I tried different arrangement of changing to bytes or back to string, but I still can't get it to work; instead I just get a slightly different error, but the whole theme is str and byte compatibility. I'd appreciate any help.