Re: Finding startup files

2005-05-11 Thread hemagician
The following script demonstrates a method that should work for you. I believe it is entirely cross-platform. #! /usr/bin/python import sys import os print os.path.abspath(os.path.dirname(sys.argv[0])) -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding startup files

2005-05-11 Thread jeff elkins
On Wednesday 11 May 2005 04:32 pm, [EMAIL PROTECTED] wrote: > The following script demonstrates a method that should work for you. I > believe it is entirely cross-platform. > > #! /usr/bin/python > > import sys > import os > > print os.path.abspath(os.path.dirname(sys.argv[0])) Works perfectly, t

Re: Finding startup files

2005-05-11 Thread Grant Edwards
On 2005-05-11, jeff elkins <[EMAIL PROTECTED]> wrote: > I'm creating an app that relies on a configuration file at > launch. The file will always exist in the app's installation > directory, That's the first decision you need to examine. If you want work on Unix platforms, that's not where confi

Re: Finding startup files

2005-05-11 Thread Grant Edwards
On 2005-05-11, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > The following script demonstrates a method that should work for you. I > believe it is entirely cross-platform. > > #! /usr/bin/python > > import sys > import os > > print os.path.abspath(os.path.dirname(sys.argv[0])) That will probably

Re: Finding startup files

2005-05-11 Thread jeff elkins
On Wednesday 11 May 2005 04:44 pm, Grant Edwards wrote: > On 2005-05-11, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > The following script demonstrates a method that should work for you. I > > believe it is entirely cross-platform. > > > > #! /usr/bin/python > > > > import sys > > import os > >

Re: Finding startup files

2005-05-11 Thread Robert Kern
jeff elkins wrote: > On Wednesday 11 May 2005 04:44 pm, Grant Edwards wrote: > >>On 2005-05-11, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> >>>The following script demonstrates a method that should work for you. I >>>believe it is entirely cross-platform. >>> >>>#! /usr/bin/python >>> >>>impor

Re: Finding startup files

2005-05-11 Thread jeff elkins
On Wednesday 11 May 2005 10:18 pm, Robert Kern wrote: > jeff elkins wrote: > > On Wednesday 11 May 2005 04:44 pm, Grant Edwards wrote: > >>On 2005-05-11, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >>>The following script demonstrates a method that should work for you. I > >>>believe it is entir

Re: Finding startup files

2005-05-11 Thread Mike Meyer
jeff elkins <[EMAIL PROTECTED]> writes: > On Wednesday 11 May 2005 04:44 pm, Grant Edwards wrote: >> On 2005-05-11, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> > The following script demonstrates a method that should work for you. I >> > believe it is entirely cross-platform. >> > >> > #! /usr

Re: Finding startup files

2005-05-12 Thread jeff elkins
On Thursday 12 May 2005 05:24 am, Mike Meyer wrote: > jeff elkins <[EMAIL PROTECTED]> writes: > > On Wednesday 11 May 2005 04:44 pm, Grant Edwards wrote: > >> On 2005-05-11, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >> > The following script demonstrates a method that should work for you. I >

RE: Finding startup files

2005-05-12 Thread Tim Golden
[Mike Meyer] [... snip discussions of where to put config files ...] | Yes, but Windows these days supports multiple users. Are you sure that | you want to restrict your users to one configuration file per | installed version of the program? | | I'm not sure Windows has a good solution to this p

Re: Finding startup files

2005-05-12 Thread Grant Edwards
On 2005-05-11, jeff elkins <[EMAIL PROTECTED]> wrote: > I'm totally new to Python (obvious,yes?) so how might argv[0] fail? argv[0] contains whatever is put there by the program that exec'ed you, and can therefore contain just about anything (or nothing). It may not contain a full path, and your

Re: Finding startup files

2005-05-12 Thread Bernhard Herzog
Grant Edwards <[EMAIL PROTECTED]> writes: > On 2005-05-11, jeff elkins <[EMAIL PROTECTED]> wrote: > >> I'm totally new to Python (obvious,yes?) so how might argv[0] fail? > > argv[0] contains whatever is put there by the program that > exec'ed you, and can therefore contain just about anything (or