Code:
import urllib2 as u import os as o inn = \'dword.txt\' w = open(inn) z = w.readline() b = w.readline() c = w.readline() x = w.readline
In my case, I had a Class with a method in it. The method did not have 'self' as the first parameter and the error was being thrown when I made a call to the method. Once I added 'self,' to the method's parameter list, it was fine.