Created
July 31, 2016 17:16
-
-
Save toocool/b09dba79f5265115ec551bb7a502300e 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 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