On May 13, 11:51 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > You meant readlines(), I presume. A file acts as its own iterator: > > f=os.open("./get_hostnames") > try: > for line in f: > # do something with line > finally: > f.close() > > -- > Gabriel Genellina
Hi - thank you for your reply. I meant: f=os.popen("./get_hostnames").readlines() So f is a list, rather than a file object, of which os.open would have returned (my initial typo redirected the missive of this post, sorry!) cheers -- http://mail.python.org/mailman/listinfo/python-list