Skip to content

Instantly share code, notes, and snippets.

@Hanrui-Wang
Created July 25, 2019 01:39
Show Gist options
  • Select an option

  • Save Hanrui-Wang/7dd833bafc8219c40cc47c8137429663 to your computer and use it in GitHub Desktop.

Select an option

Save Hanrui-Wang/7dd833bafc8219c40cc47c8137429663 to your computer and use it in GitHub Desktop.
read file line by line
with open(path, 'r') as f:
for line in f:
# no need to lines = f.read().split('\n')[:-1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment