Re: __file__ is sometimes absolute, sometimes relative

2010-10-01 Thread Antoine Pitrou
On Fri, 1 Oct 2010 21:00:02 +0200 Sébastien Barthélemy wrote: > Hi, > > Arnaud, Christian, thank you for your help. > > I'll use abspath, it's shorter. > > Any idea why it's sometimes absolute, sometimes not? AFAICT, that's because sys.path contains some absolute paths and some relative ones.

Re: __file__ is sometimes absolute, sometimes relative

2010-10-01 Thread Sébastien Barthélemy
Hi, Arnaud, Christian, thank you for your help. I'll use abspath, it's shorter. Any idea why it's sometimes absolute, sometimes not? -- http://mail.python.org/mailman/listinfo/python-list

Re: __file__ is sometimes absolute, sometimes relative

2010-10-01 Thread Arnaud Delobelle
Sébastien Barthélemy writes: > Hello, Hi! > I use a data file that lies on disk in the same directory that the > module which makes use of it. > > The data file is checked in the repository and gets installed by > the distutils ``package_data`` directive, so it is in place both > during develop

Re: __file__ is sometimes absolute, sometimes relative

2010-10-01 Thread Christian Heimes
Am 01.10.2010 13:00, schrieb Sébastien Barthélemy: > Hello, > > I use a data file that lies on disk in the same directory that the > module which makes use of it. > > The data file is checked in the repository and gets installed by > the distutils ``package_data`` directive, so it is in place bot

__file__ is sometimes absolute, sometimes relative

2010-10-01 Thread Sébastien Barthélemy
Hello, I use a data file that lies on disk in the same directory that the module which makes use of it. The data file is checked in the repository and gets installed by the distutils ``package_data`` directive, so it is in place both during development and after and install. In my program, I nee