Re: a popen question. Please help

2009-08-31 Thread Aahz
In article , Tim Chase wrote: > >Darn "standards" :-/ The wonderful thing about standards is that there are so many to choose from. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "I support family values -- Addams family values" --www.nancybuttons.com -- http

Re: a popen question. Please help

2009-08-30 Thread Tim Chase
os.popen('top -n1').readlines() Hm, interesting. On Mac OS X's (and BSD's?) top, -n instead specifies the number of processes to list at a time (i.e. list only the top N processes), which is entirely different. [reaching over to my Mac] Looks like "top" there supports a -l parameter which do

Re: a popen question. Please help

2009-08-30 Thread Chris Rebert
On Sun, Aug 30, 2009 at 4:43 AM, Tim Chase wrote: >> texts = os.popen('top').readlines() >> print texts >> >> It calls the command line "top" and will print out some texts. >> But first I have to press the keyboard "q" to quit the subprocess "top", >> then the texts will be printed, otherwise it ju

Re: a popen question. Please help

2009-08-30 Thread Tim Chase
texts = os.popen('top').readlines() print texts It calls the command line "top" and will print out some texts. But first I have to press the keyboard "q" to quit the subprocess "top", then the texts will be printed, otherwise it just stands by with blank. Question is. Do you know how to give "q