aitech-eks-pub/convert_python_to_markdown.py
2021-09-27 13:29:40 +02:00

14 lines
333 B
Python

import sys
from bs4 import BeautifulSoup
from markdown import markdown
with open(sys.argv[1]) as f_in, open(sys.argv[2],'w') as f_out:
for i, line in enumerate(f_in):
if i in (1,2):
continue
if line[:2] == "# " and line[:5] != "# In[":
text = line[:2]
f_out.write(line[2:])