I've got this error. Why?
File "/k.py", line 257, in deskJ
eremuak = aFileLine.strip().split('\t')
AttributeError: '_io.BufferedReader' object has no attribute 'strip'
Code
def deskribapenaJaso(self, aFileLine):
eremuak = aFileLine.strip().split('\t')
print(eremuak) #printNothing
aFileLine = It's the X line of a file
You are using str
methods on an open file object.
You can read the file as a list of lines by simply calling list()
on the file object:
with open('goodlines.txt') as f:
mylist = list(f)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With