osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

absolute path to a file


On 17/08/2019 16:32, Dennis Lee Bieber wrote:
> On Sat, 17 Aug 2019 11:51:47 +0200, Paul St George <email at paulstgeorge.com>
> declaimed the following:
> 
> 
>>   print('Track E  from Track B:',os.path.realpath(n.image.filepath[1:]))
>> ---Track E  from Track B: /image01.tif
>>
> 
> 	Just for giggles, what happens if you preface that with a single
> period...
> 
> print('Track E  from Track B:',os.path.realpath("." +
> n.image.filepath[1:]))
> 
> 
> 

print('Track E for giggles from Track B:',os.path.realpath("." + 
n.image.filepath[1:]))

gives:

Track E for giggles from Track B: /images/blah.tif