On Sat, 29 Aug 2009, Chris Morley wrote:
> I want to open a terminal and display the output of lspci -v | less in a
>
> The answer was to add the sleep command:
> terminal = os.popen("gnome-terminal --title=Parport_address_search -x lspci
> -v ;sleep 1", "w" )
You shouldn't ever explicitly call gnome-terminal; I might not like
gnome-terminal or even have it installed. Use x-terminal-emulator instead.
Second, why are you opening a new terminal window instead of using a text
field widget or printing to stdout? that's bad manners. Still, in general
it's a bad idea to embed a terminal in your app. You should probably just
do the searching/parsing of the string in your code and display a list of
options instead of making the user scroll through piles of text.
something like:
match = re.search('parport.*\nAddress: (.*)', os.popen('lspci -v').read())
if match: print match.groups()
I don't see anything specifically labeled "parport" or "ISA" or "parallel"
on this machine's lspci output, even though it has a (builtin) parport.
So, now I'm wondering what you were trying to do in the first place.
-fenn
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers