<br><div class="gmail_quote">On Mon, Jul 30, 2012 at 9:26 PM, Barry Scott <span dir="ltr"><<a href="mailto:barry@barrys-emacs.org" target="_blank">barry@barrys-emacs.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><div>lspci gets all its information from the files in /sys/bus/pci/devices.</div></div></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="word-wrap:break-word"><div>You can use os.listdir() to list all the files in the folder and then open</div><div>the files you want to get the data you need.</div></div></blockquote><div>Gee, wouldn't it be more portable to parse lspci?  I wouldn't put it past the (Linux) kernel devs to move the pseudo-filesystems around again...<br>
 <br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div>And of course you can write list comprehensions on as many lines as</div>
<div>it take to make the code maintainable.</div></div></blockquote><div>Sigh, and I'm also not keen on multi-line list comprehensions, specifically because I think they tend to make less readable code.  It also becomes a mess when you need to insert print statements to get some visibility into what's going on.<br>
<br></div></div>