Easy way to distribute python scripts?

hi there,

I’m currently working on some python scripts to speed up a workflow. The scripts will be called through buttons on their own toolbar.
They rely on some modules and a few other files (e.g. textures). Right now the texture path is hardcoded, but that won’t (probably) work if they are installed on another machine. Do you have any idea how I could solve this?

For distribution I’ve already tried the RhinoPython Compiler, which does create a valid plugin, but the commands won’t work as they rely (/import) modules. I’ve found some threads here in the forums which state that this isn’t supported atm.

Are there any other easy ways to distribute the scripts with all necessary files? The scripts can still be readable for others, they don’t need to be compiled.

FYI: I’m not a Rhino user, only started working with it on this project, but I find my around Rhino for the stuff I need :wink:

Thanks you!


I’m not a python user but with vb.Net there is an application path. Maybe its there too for python?
It gets the dir of the locaton where you located your scrypt. After I typed Application Path Python I got this:

application_path = os.path.dirname(__file__)

it should give you the dir of your scipt… this application_path is variable and chnages when you move your script around.