Date: Thu, 19 Aug 2004 11:19:05 +0900 From: Hye-Shik Chang <hyeshik@gmail.com> To: Max Russell <max_russell2000@yahoo.co.uk> Cc: freebsd-python@freebsd.org Subject: Re: startfile() equivalent Message-ID: <4f0b69dc0408181919172d239d@mail.gmail.com> In-Reply-To: <20040818100943.44985.qmail@web25405.mail.ukl.yahoo.com> References: <20040818100943.44985.qmail@web25405.mail.ukl.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 18 Aug 2004 11:09:43 +0100 (BST), Max Russell
<max_russell2000@yahoo.co.uk> wrote:
> Hello-
>
> I'm scripting a little thing to pick a random MAME
> file and launch it (save me the hassle of choosing
> one).
>
> Does startfile work on BSD/Linux?
os.startfile() is only available in Windows.
> How can I do the equivalent to the python win32
> startfile()?
>
> If I cannot use this, how can I say execute this command?
>
It depends what your desktop environment is. If you run GNOME,
you can write it like this:
import os
def startfile(url):
os.system("gnome-open " + url) # quote if you can't trust user.
Hye-Shik
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4f0b69dc0408181919172d239d>
