Re: Obtaining a full path name from file

2011-05-25 Thread Dave Angel
On 01/-10/-28163 02:59 PM, RVince wrote: s = "C:\AciiCsv\Gravity_Test_data\A.csv" f = open(s,"r") How do I obtain the full pathname given the File, f? (which should equal "C:\AciiCsv\Gravity_Test_data"). I've tried all sorts of stuff and am just not finding it. Any help greatly appreciated !

Re: Obtaining a full path name from file

2011-05-25 Thread Tim Golden
On 25/05/2011 07:36, Ulrich Eckhardt wrote: RVince wrote: s = "C:\AciiCsv\Gravity_Test_data\A.csv" f = open(s,"r") How do I obtain the full pathname given the File, f? Apart from the issue that the 'name' attribute is only the name used to open the file, there is another issue, though not on

Re: Obtaining a full path name from file

2011-05-25 Thread Ulrich Eckhardt
RVince wrote: > s = "C:\AciiCsv\Gravity_Test_data\A.csv" > f = open(s,"r") > > How do I obtain the full pathname given the File, f? Apart from the issue that the 'name' attribute is only the name used to open the file, there is another issue, though not on the platform you're using: Multiple di

Re: Obtaining a full path name from file

2011-05-24 Thread Michael Kent
If a filename does not contain a path component, os.path.abspath will prepend the current directory path onto it. -- http://mail.python.org/mailman/listinfo/python-list

Re: Obtaining a full path name from file

2011-05-24 Thread Jean-Michel Pichavant
RVince wrote: Ha! You;re right -- but is there a way to get it without the filename appended at the end? On May 24, 11:52 am, Tim Golden wrote: On 24/05/2011 16:36, RVince wrote: s = "C:\AciiCsv\Gravity_Test_data\A.csv" f = open(s,"r") How do I obtain the full pathname given t

Re: Obtaining a full path name from file

2011-05-24 Thread Tim Golden
On 24/05/2011 17:04, RVince wrote: Ha! You;re right -- but is there a way to get it without the filename appended at the end? Well, just use the functions in os.path, specifically os.path.dirname... TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: Obtaining a full path name from file

2011-05-24 Thread Chris Angelico
On Wed, May 25, 2011 at 2:04 AM, RVince wrote: > Ha! You;re right -- but is there a way to get it without the filename > appended at the end? Parse the file name with the os.path functions: http://docs.python.org/library/os.path.html Chris Angelico -- http://mail.python.org/mailman/listinfo/py

Re: Obtaining a full path name from file

2011-05-24 Thread Mel
Tim Golden wrote: > On 24/05/2011 16:36, RVince wrote: >> s = "C:\AciiCsv\Gravity_Test_data\A.csv" >> f = open(s,"r") >> >> How do I obtain the full pathname given the File, f? (which should >> equal "C:\AciiCsv\Gravity_Test_data"). I've tried all sorts of stuff >> and am just not finding it. Any

Re: Obtaining a full path name from file

2011-05-24 Thread RVince
Ha! You;re right -- but is there a way to get it without the filename appended at the end? On May 24, 11:52 am, Tim Golden wrote: > On 24/05/2011 16:36, RVince wrote: > > > s = "C:\AciiCsv\Gravity_Test_data\A.csv" > > f = open(s,"r") > > > How do I obtain the full pathname given the File, f? (whi

Re: Obtaining a full path name from file

2011-05-24 Thread Tim Golden
On 24/05/2011 16:36, RVince wrote: s = "C:\AciiCsv\Gravity_Test_data\A.csv" f = open(s,"r") How do I obtain the full pathname given the File, f? (which should equal "C:\AciiCsv\Gravity_Test_data"). I've tried all sorts of stuff and am just not finding it. Any help greatly appreciated ! You're

Obtaining a full path name from file

2011-05-24 Thread RVince
s = "C:\AciiCsv\Gravity_Test_data\A.csv" f = open(s,"r") How do I obtain the full pathname given the File, f? (which should equal "C:\AciiCsv\Gravity_Test_data"). I've tried all sorts of stuff and am just not finding it. Any help greatly appreciated ! -- http://mail.python.org/mailman/listinfo/py