Created
May 13, 2020 14:15
-
-
Save phanthaihuan/fd35435a37d1980fd1c8eff0d6cabbce to your computer and use it in GitHub Desktop.
How to read file in Python
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
#!/usr/bin/env python | |
import os | |
PWD = os.getcwd() | |
my_file = os.path.join(PWD, 'data.txt') | |
with open(my_file) as f: | |
for line in f: | |
print(line) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment