How should I use a file reader class in Python?
<p>I'd like to figure out how I should use a class to read input from a file so that I can use that data in other classes. If I read input from a file into a list, should I pass that to another class that needs that to use that information?</p>

<p>Right now I have:</p>

<pre><code>import sys

class FileReader:
    """Reads a file"""
    def __init__(self):
        input = ''
        try:
            with open(sys.argv[1], 'r') as inFile:
                input = inFile.readline()
                print(input)
        except IndexError:
            print("Error - Please specify an input file.")
            sys.exit(2)

def main():
    x = FileReader()

if __name__ == "__main__":
    main()
</code></pre>

<p>I thought about making some kind of list to hold strings from the file, but I'm not sure whether that should be global or not.</p>
