Open paccattam opened 5 years ago
@paccattam I'm not entirely sure what you are asking us to do, can you clarify a little bit?
Are you saying the 2nd snippet should be:
fname = "yourfile.txt"
with open(fname, 'r') as fileref: # step 1
for lin in fileref.readlines(): # step 2
## some code that reference the variable lin
#some other code not relying on fileref # step 3
The example should be:
with open(fname, 'r') as fileref:
for line in fileref:
## some code that uses line as the current line of the file
## some more code
fileref.readlines
is not wrong its just not necessary.
It should be lin
rather than line
, to be compatible with the previous example on the page.
Issued a pull request
Just checking in on this issue. It appears a fix has been initiated. Can this issue/ticket be closed?
Still waiting for some changes to the PR, we can close as soon as the PR is accepted.
The following code snippet given in the end of the text @ the link given below should have mentioned fire opbject reference instead of "lines" https://fopp.umsi.education/runestone/static/fopp/Files/FilesRecipe.html