Post #2821: ![](https://blenderartists.org/user_avatar/blenderartists.org/sergey_kritskiy/48

šŸ“‹ Metadata

šŸ·ļø Tags

scripting intermediate solved

  • Python Scripting
  • Macro Editor

šŸ’¬ Content

Sergey_Kritskiy:

I’d like to share the same pie menu that calls for external .py scripts between two my machines, but paths to scripts are different due to Dropbox setup. Is it possible to use OS environmental variables in execute_script("")? So instead of execute_script("D:/Dropbox/script.py") I’d use something like execute_script("$BLENDER_SCRIPTS/script.py")

Hi @Sergey_Kritskiy,
Yes, try something like this:

import os; execute_script(os.path.join(os.environ["BLENDER_SCRIPTS"], "script.py"))

ā¤ļø 2 likes


šŸ”— View on Blender Artists