Skip to content

Instantly share code, notes, and snippets.

@congjf
Created November 29, 2018 07:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save congjf/0f647fbe19d29bb274b6f32528505cb0 to your computer and use it in GitHub Desktop.
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
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