> Date: Sat, 29 Aug 2009 09:47:28 +0000
> From: [email protected]
> To: [email protected]
> Subject: Re: [Emc-developers] help with gnome-terminal commands in python
>
> 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.
Well that is a good point. I know nothing of x-terminal-emulator but can
research it.
>
> 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.
I guess I could do that. I just saw nothing bad about opening another
window as a terminal. It's the same thing one would do if they did it
themselves. Plus of course it seemed easy to do. Basically I don't
know any better! lol
>
> 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
I added a button to initiate searching for PCI add-on parport cards
by issuing lspci -v in a terminal. I assume if an on-board parport
isn't bridged through PCI it won't show up, but on-board parports
are usually at standard addresses anyways.
Thanks for your help!
Chris Morley
_________________________________________________________________
More storage. Better anti-spam and antivirus protection. Hotmail makes it
simple.
http://go.microsoft.com/?linkid=9671357------------------------------------------------------------------------------
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