On Mon, Apr 12, 2010 at 11:31 AM, Maggie <la.f...@gmail.com> wrote: > hello, > > i have a basic script i need to implement. i need below code to read > in a file and perform operation is it designed to do: > > #!/usr/bin/python > > import sys > > feed = sys.stdin.readlines()
This sounds like homework, so here are some clues: sys.stdin is a file object. open('/path/to/file.here', 'r') creates a new readable file object representing the file at the given path. You should be able to figure it out from there. Cheers, Chris -- s/aaa/bbb/ http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list