Re: OS independent files

2006-08-03 Thread Roger Upole
"Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote: > On Thu, 03 Aug 2006 21:55:21 +0200, Jarek Zgoda <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> crystalattice napisa?(a): >> >> > If I want to make sure the file/directory is made in a user's home >> > directory (e.g. /home/u

Re: OS independent files

2006-08-03 Thread Gerhard Fiedler
On 2006-08-03 16:21:13, crystalattice wrote: > I'm sure this has been addressed before but it's difficult to search > through several thousand postings for exactly what I need, so I > apologize if this a redundant question. > > I've figured out how to use os.path.join to make a file or directory

Re: OS independent files

2006-08-03 Thread Jarek Zgoda
Tim Chase napisał(a): > Well, there in os.path you'll find expanduser() so you can do things like > homedir = os.path.expanduser("~") filename = os.path.join(homedir, "myfiles", "myfile.dat") > > Seems to work well for me. On Windows, this is consistent between releases (i.e. you'll e

Re: OS independent files

2006-08-03 Thread crystalattice
Simon Forman wrote: > Google groups has a very good search. That's what I'm using, and it still came up with 600-900 results depending on my search terms. > Try os.path.expanduser('~') (in > http://docs.python.org/lib/module-os.path.html) or you could just look > up the HOME environment variable

Re: OS independent files

2006-08-03 Thread Jarek Zgoda
crystalattice napisał(a): > If I want to make sure the file/directory is made in a user's home > directory (e.g. /home/users/path/to/file) but also compatible w/ > Windows, how would I rewrite this (if required)? On Windows, there's no notion of user's home directory, there is a directory for use

Re: OS independent files

2006-08-03 Thread Tim Chase
> location prior to pickling something to it. But I have a question > about it. In Windows I can make a file with this: > > os.path.join("C:", "myfiles", "myfile.dat") > > If I want to make sure the file/directory is made in a user's home > directory (e.g. /home/users/path/to/file) but also com

Re: OS independent files

2006-08-03 Thread Simon Forman
crystalattice wrote: > I'm sure this has been addressed before but it's difficult to search > through several thousand postings for exactly what I need, so I > apologize if this a redundant question. Google groups has a very good search. > I've figured out how to use os.path.join to make a file o

Re: OS independent files

2006-08-03 Thread Larry Bates
crystalattice wrote: > I'm sure this has been addressed before but it's difficult to search > through several thousand postings for exactly what I need, so I > apologize if this a redundant question. > > I've figured out how to use os.path.join to make a file or directory > location prior to pickl

OS independent files

2006-08-03 Thread crystalattice
I'm sure this has been addressed before but it's difficult to search through several thousand postings for exactly what I need, so I apologize if this a redundant question. I've figured out how to use os.path.join to make a file or directory location prior to pickling something to it. But I have