Skip to content

Instantly share code, notes, and snippets.

@tcmhoang
Created July 24, 2020 06:09
Show Gist options
  • Save tcmhoang/6c3cee18856750b69f97d5f5d12ce07a to your computer and use it in GitHub Desktop.
Save tcmhoang/6c3cee18856750b69f97d5f5d12ce07a to your computer and use it in GitHub Desktop.
def loadHTMLCode():
print('Loading codes form HTML files')
res = []
with open("input.txt",'r') as inFile:
for line in inFile:
s = line.strip();
words = s.split("\\")
tmp = "\\\\".join(words)
tmpWords = tmp.split('"')
res.append('\\"'.join(tmpWords))
print(len(res), "lines loaded.")
return res
def convertHTMLtoJPSCode(res):
print(*("out.println(\"{0}\");".format(line) for line in res), sep="\n")
convertHTMLtoJPSCode(loadHTMLCode())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment