get script directory at runtime
#1
is it possible to get the directory from where a executing script is loaded during runtime? (probably more a python thing than xbmc)

i am hoping that i don't have to hard code any paths in my script.

thanks,
george
Reply
#2
getcwd()[:-1] will return the scripts current working directory.



For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#3
more exactly :
import os
scriptpath = os.getcwd()[:-1]+"\\" #will return something like q:\scripts\yourscriptpath\
Reply
#4
thanks...
Reply

Logout Mark Read Team Forum Stats Members Help
get script directory at runtime0