I am using Python 3.5 but this book is teaching 2.7 (beats me why in 2016)
Learning Predictive Analytics with Python by Ashish Kumar Feb 15, 2016
>>> data=open(filename,'r')
>>> cols=data.next().strip().split(',')
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
cols=data.next().strip().split(',')
AttributeError: '_io.TextIOWrapper' object has no attribute 'next'
>>>
I have read this AttributeError: '_io.TextIOWrapper' object has no attribute 'next' python and I still don't know how to get it to work in Python 3.5 GUI shell.
So far, I understand for Python 3.5 I have to use .__next__
; for Python 2.7 .next
.