16 May 17:55
Re: Open a directory in the default file manager
From: Thomas Pani <thomas.pani <at> gmail.com>
Subject: Re: Open a directory in the default file manager
Newsgroups: gmane.comp.python.tutor
Date: 2008-05-16 15:55:58 GMT
Subject: Re: Open a directory in the default file manager
Newsgroups: gmane.comp.python.tutor
Date: 2008-05-16 15:55:58 GMT
Tim Michelsen wrote: > Hello, > is there any function/module that allows me to open a directory in the > default file manager of a operating system? On Windows you can use os.startfile(). On "pure" Unices there's no such thing as filetype associations However, if you use a desktop environment, you can spawn xdg-open (from xdg-utils) from Python. This will autodetect gnome, kde and xfce and use their tools (gnome-open, kfmclient, exo-open). I think on OS X/Darwin there's a similar utility called `open'. You can use sys.platform to determine which system you're running on. thomas _______________________________________________ Tutor maillist - Tutor <at> python.org http://mail.python.org/mailman/listinfo/tutor
RSS Feed