Created
February 26, 2023 09:03
-
-
Save jutikorn/0f78eef98f2c660217467cabbcbfc8b0 to your computer and use it in GitHub Desktop.
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
def read_file_line_by_line(filename, pattern): | |
if not filename.endswith('.kt') and not filename.endswith('.java') and not filename.endswith('.xml'): | |
print(f' Invalid file. filename is {filename}') | |
return | |
try: | |
with open(filename, 'r', encoding='UTF-8') as file: | |
while (line := file.readline().rstrip()): | |
print(line) | |
except: | |
print(filename) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment