Skip to content

Instantly share code, notes, and snippets.

@toocool
Created July 31, 2016 17:16
Show Gist options
  • Save toocool/b09dba79f5265115ec551bb7a502300e to your computer and use it in GitHub Desktop.
Save toocool/b09dba79f5265115ec551bb7a502300e to your computer and use it in GitHub Desktop.
import re
def transform(input):
HTMLoutput = ""
for line in input.splitlines():
HTMLoutput = re.findall(r"(\w+)(\s+)(:)", line)
return HTMLoutput #return behen krejt qe jan be match
TestIt = transform("a34asd3342sd :asdaasd 324sd:asd324:321d :asdasd:asdasd")
#TestIt e kemi vendos 1 input veq per test edhe duhet te bej 2 her match
template = "{0:15}|{1:45}|"
print("|------------------------------------------------------------|")
for index, header in enumerate(TestIt):
print(template.format("| dataset"+str(index+1)+" " ," <h2>" + header[0] + "</h2>"))
print("|------------------------------------------------------------|")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment