You could also use the subprocess module, which like os.system, doesn't care about the absolute path of the executable.<br><br>import subprocess<br>p = subprocess.Popen(['aptitude', 'search', 'gnome'])<br>
p.wait()<br><br><br><div class="gmail_quote">On Thu, Sep 16, 2010 at 7:07 PM, Cosme Domínguez <span dir="ltr"><<a href="mailto:cosme.ddiaz@gmail.com">cosme.ddiaz@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
2010/9/17 Stephen Burke <<a href="mailto:steve.burke.56@gmail.com">steve.burke.56@gmail.com</a>>:<br>
<div class="im">> I'm writing a python script and I'm using aptitude and update-grub in<br>
> the script. Currently I just use the abolute path to the bins ie.<br>
> /usr/bin/aptitude. Ultimately I'd like to package it and distribute<br>
> it as a deb. What's the recommended way to get these paths so they<br>
> will work on any user's machine? Are there any environment vars that<br>
> I should use or a service of some kind?<br>
><br>
> Any help or pointing in the right direction would be appreciated or if<br>
> there is a better list to post this let me know.<br>
<br>
</div><a href="http://docs.python.org/library/os.html#os.system" target="_blank">http://docs.python.org/library/os.html#os.system</a><br>
<div><div></div><div class="h5"><br>
--<br>
Ubuntu-devel-discuss mailing list<br>
<a href="mailto:Ubuntu-devel-discuss@lists.ubuntu.com">Ubuntu-devel-discuss@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss" target="_blank">https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss</a><br>
</div></div></blockquote></div><br>