dmao
(dmao)
July 24, 2004, 11:55am
1
my script looks something like this:
import Blender
import pickle
SomeJunk = "blah blah blah"
f = file('junk.txt', 'w')
pickle.dump(SomeJunk, f)
f.close()
The output always goes to Blender’s folder, as in the one with Blender.exe. Is there a way to save the output to the folder containing the .blend file the script was run from? thanks!
jms
(jms)
July 24, 2004, 12:14pm
2
import Blender
ls=Blender.Get(‘filename’)
rep=Blender.sys.dirname(ls)
z3r0_d
(z3r0 d)
July 24, 2004, 1:19pm
3
… well anway
import Blender
import pickle
SomeJunk = "blah blah blah"
f = file(Blender.sys.dirname(Blender.Get('filename')) + Blender.sys.sep + 'junk.txt', 'w')
pickle.dump(SomeJunk, f)
f.close()
before now I didn’t know that the often-used parts of the os module were in Blender.sys
dmao
(dmao)
July 24, 2004, 4:18pm
4
Perfect, problem solved! Thanks guys!