Here’s how to read a file line by line with multiple columns.
with open('file.txt') as file: for line in file: line = line.strip() columns = line.split() col1 = columns[0] col2 = columns[1] some_function(col1, col2) |
cloud engineer
Here’s how to read a file line by line with multiple columns.
with open('file.txt') as file: for line in file: line = line.strip() columns = line.split() col1 = columns[0] col2 = columns[1] some_function(col1, col2) |
with open('file.txt') as file: for line in file: line = line.strip() columns = line.split() col1 = columns[0] col2 = columns[1] some_function(col1, col2)
How to Split Text into Columns in Excel.
If you have a long list of words laid out on a page (see list below), it might be better to place them in a multi-column page format. CSS3 makes this entirely possible without using tables or multiple divs. All we need is a single div for the entire list. In this example, we will work with a list of animals. We will use a div class called “animals.”
To use multi-columns, we simply style the div with:
.animals {-moz-column-count:3; -webkit-column-count:3; column-count:3;} |
.animals {-moz-column-count:3; -webkit-column-count:3; column-count:3;}
Multi-column divs is supported on Firefox, Safari, Chrome and IE browsers.
Just change the numbers to make multiple columns.