Created
November 29, 2018 07:42
-
-
Save congjf/0f647fbe19d29bb274b6f32528505cb0 to your computer and use it in GitHub Desktop.
A function to convert the String object with certain row flag and column flag to the table (list) object
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
def str_to_table(str, row_flag, col_flag): | |
rows = str.split(row_flag) | |
table = [] | |
for r in rows: | |
cells = r.split(col_flag) | |
table.append(cells) | |
return table | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment