Created
July 19, 2020 08:49
-
-
Save raeq/a030e3ce6a1ccbd5ae3b401a98e12df7 to your computer and use it in GitHub Desktop.
Return a list from a file path
This file contains hidden or 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 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