Python creates a rows by cols 2D list of integers filled with space-separated integers from f_in. If f_in does not have enough values, fill the remaining slots with 0s. If f_in has too many values, the excess values are ignored.
Use: matrix = fill_matrix(fh_in, rows, cols)