Page 1 of 1


Posted: Wed Aug 07, 2013 1:50 pm
by Akos
Can anyone show me how can i find the path of the working folder. I am trying to make a code in which i inted to create a file.txt . The only problem is that if i dont specify the path I creates it in the blender source code folder and the in the folder where my objects are.

I tryed bpy.path, but it's not good.

Posted: Wed Aug 07, 2013 11:57 pm
by CoDEmanX
should be the working dir:

>>> os.getcwd()
'C:\\Program Files\\Blender Foundation\\Blender'

>>> os.path.dirname(
'C:\\Program Files\\Blender Foundation\\Blender'

>>> os.path.dirname(sys.argv[0])
'C:\\Program Files\\Blender Foundation\\Blender'

or one of these?

Posted: Thu Aug 08, 2013 11:02 am
by Akos
:oops: Thanks, but they didn't worked out for me. They were returning the following directories :
And my intention were to find the directory were the .blend file is, which is :
Do you have any suggestion ? Or anybody else ?

Thanks again,

Posted: Thu Aug 08, 2013 5:48 pm
by CoDEmanX
I see, you didn't state that clear enough. Try

Posted: Thu Aug 08, 2013 6:01 pm
by Akos
Thank you a lot !

Sorry for my ambiguous language. I'm new to this environment and a beginner in programming.