I\'m writing some code that takes a filename, opens the file, and parses out some data. I\'d like to do this in a class. The following code works:
class MyCl
I think that your problem is actually with not correctly indenting init function.It should be like this
class MyClass(): def __init__(self, filename): pass def parse_file(): pass