On May 13, 11:25 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Tue, 13 May 2008 04:14:16 -0700 (PDT), [EMAIL PROTECTED] > declaimed the following in comp.lang.python: > > > 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!) > > Other than the facet that os.open() is low-level C file object and > not a Python file object... > > What you have returned is a list of lines... Hmmm, if os.popen() > supports .readlines() it might even support direct iteration > > for ln in os.popen(): > do something with the line > > Now the matter comes down to what each line looks like... It is NOT > a "list" in Python terms, no matter what delimiters it has (and one of > your examples doesn't even seem to be consistant -- [' .... ]' is not > the same as [' .... '] ) > > For space separated hostnames.... > > for ln in os.popen(...): #assuming it works without a preread > for host in ln.split(): > do something with host... > -- > Wulfraed Dennis Lee Bieber KD6MOG > [EMAIL PROTECTED] [EMAIL PROTECTED] > HTTP://wlfraed.home.netcom.com/ > (Bestiaria Support Staff: [EMAIL PROTECTED]) > HTTP://www.bestiaria.com/
Compositions can't have names in the singular case. -- http://mail.python.org/mailman/listinfo/python-list