Google Groups Home
Help | Sign in
Message from discussion Best way to delimit a list?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
dannywebs...@googlemail.com  
View profile
 More options May 13, 7:14 am
Newsgroups: comp.lang.python
From: dannywebs...@googlemail.com
Date: Tue, 13 May 2008 04:14:16 -0700 (PDT)
Local: Tues, May 13 2008 7:14 am
Subject: Re: Best way to delimit a list?
On May 13, 11:51 am, "Gabriel Genellina" <gagsl-...@yahoo.com.ar>
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


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google