Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
print("\ncurrent fh.tell()", fh.tell())

# TO read current line, from cursor position, till end of line
current_line = fh.readline() # -> str
current_line = fh.readline(5_000_000) # -> str
print(f"\n{type(current_line) =}") # str type
print(f"{current_line =}")

print("\ncurrent fh.tell()", fh.tell())
current_line = fh.readline() # -> str
current_line = fh.readline(5_000_000) # -> str
print(f"{current_line =}")


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
def read_from_file(file_name):
"""Method 1 - reading one line per iteration"""
with open(file_name, "r") as fp:
yield fp.readline()
yield fp.readline(5_000_000)


def read_from_file2(file_name, block_size=1024 * 8):
Expand Down
Loading