Skip to content

Instantly share code, notes, and snippets.

@raeq
Created July 19, 2020 08:49
Show Gist options
  • Save raeq/a030e3ce6a1ccbd5ae3b401a98e12df7 to your computer and use it in GitHub Desktop.
Save raeq/a030e3ce6a1ccbd5ae3b401a98e12df7 to your computer and use it in GitHub Desktop.
Return a list from a file path
def file_to_list(filename: str = "") -> list:
with open(filename, "r") as f:
lines = list(f)
return lines
assert len(file_to_list("<PATH TO FILE>")) == LINE_COUNT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment