Created
July 19, 2020 08:38
-
-
Save cftang0827/18f8e6d7ba9150b50722ae36739f7d49 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import os | |
parser = argparse.ArgumentParser() | |
parser.add_argument("html") | |
args = parser.parse_args() | |
with open(os.path.join(".", args.html)) as f: | |
texts = f.readlines() | |
with open(os.path.join(".", "output.html"), "w") as f: | |
f.writelines("<html>\n<div>") | |
for t in texts: | |
f.writelines(t.replace("\n", "<br>")) | |
f.writelines("</div>\n</html>") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment