Python to create tables
Revision as of 16:42, 25 September 2020 by Nicholas w (talk | contribs) (Created page with "# this is a python script to turn text into table for wiki thing = """ Material Colour Thickness Speed Power Comment Perspex Black 3 20 55 Perspex Clear - 450 12 - 22 En...")
- this is a python script to turn text into table for wiki
thing = """
Material Colour Thickness Speed Power Comment
Perspex Black 3 20 55
Perspex Clear - 450 12 - 22 Engrave - see sample
"""
lines = thing.splitlines()
i = 0 output = for line in lines: eachTabs = line.split('\t') output += '|-\n' for each in eachTabs: output+= '| ' + each + ' |' output = output[:-1] output += '\n'
print(output)
"""
| Header text | Header text | Header text | Header text | Header text | Header text |
|---|---|---|---|---|---|
| Example | Example | Example | Example | Example | Example |
"""