Re: absolute path to a file

2019-08-17 Thread Cameron Simpson
On 17Aug2019 11:51, Paul St George wrote: print('Track D from Track B:',os.path.realpath(n.image.filepath)) ---Track D from Track B: /image01.tif print('Track E from Track B:',os.path.realpath(n.image.filepath[1:])) ---Track E from Track B: /image01.tif print('Track F from Track C:',os.pat

Re: absolute path to a file

2019-08-17 Thread Paul St George
On 17/08/2019 15:37, Peter Otten wrote: Paul St George wrote: Can someone please tell me how to get the absolute path to a file? I have tried os.path.abspath. In the code below I have a problem in the final line (15). # |import bpy|| Is this blender? If so the "//" prefix starts making sense

Re: absolute path to a file

2019-08-17 Thread Richard Damon
On 8/17/19 10:21 AM, Paul St George wrote: > Yes, it is Blender and the bpy.path.abspath() works! > And thank you also for the link to the docs. They say: > Returns the absolute path relative to the current blend file using the > “//” prefix. > > So does Blender have its own Python??? I don't

Re: absolute path to a file

2019-08-17 Thread Paul St George
On 17/08/2019 16:32, Dennis Lee Bieber wrote: On Sat, 17 Aug 2019 11:51:47 +0200, Paul St George 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 th

Re: absolute path to a file

2019-08-17 Thread Paul St George
On 17/08/2019 15:37, Peter Otten wrote: Paul St George wrote: Can someone please tell me how to get the absolute path to a file? I have tried os.path.abspath. In the code below I have a problem in the final line (15). # |import bpy|| Is this blender? If so the "//" prefix starts making sense

Re: absolute path to a file

2019-08-17 Thread Peter Otten
Paul St George wrote: > Can someone please tell me how to get the absolute path to a file? I > have tried os.path.abspath. In the code below I have a problem in the > final line (15). > > # > |import bpy|| Is this blender? If so the "//" prefix starts making sense: https://docs.blender.org/api/

Re: absolute path to a file

2019-08-17 Thread Manfred Lotz
Hi Paul, Here an example how I used both functions https://gitlab.com/snippets/1886520 Hope this helps. -- Manfred -- https://mail.python.org/mailman/listinfo/python-list

Re: Meanwhile Norwegian trolls created ...

2019-08-17 Thread Pankaj Jangid
Abdur-Rahmaan Janhangeer writes: > Was browsing when i came across this hilarious piece of text: > > source: http://enki-editor.org/2014/08/23/Pyqt_mem_mgmt.html > I haven't searched for it though, but I guess if there is a Qt like framework in Rust then a Python wrapper around it would behave mo

Re: absolute path to a file

2019-08-17 Thread Paul St George
On 17/08/2019 01:07, Gregory Ewing wrote: On Sat, Aug 17, 2019 at 2:27 AM Paul St George wrote: BUT does not work with | print('test2:',os.path.realpath(n.image.filepath))| This returns only |/image01.tif| What does n.image.filepath look like on its own? If it starts with a leading slash,

Meanwhile Norwegian trolls created ...

2019-08-17 Thread Abdur-Rahmaan Janhangeer
Was browsing when i came across this hilarious piece of text: *Once upon a time there was a programming language called C. And it had 2 memory management functions: malloc() and free(). But it was too complicated. Bjarne Stroustrup decided that C memory management should be easier. So he invented