Just discovered this a while back:
The scenario: An animation student using a “public” computer lab has a rig that requires python scripts to work, but the lab restricts editing path variables and utilizes some sort of “deep freeze” on its desktops so that one can’t keep the scripts in the “/Documents/Maya/(Maya -version)/scripts” directory. One workaround is to embed the python scripts in the Maya file itself and have them executed via scriptNodes and scriptJobs. Because scriptNodes don’t handle python properly, one solution I’ve found is to store the entire python code as a string attribute on a node and in the script node:
string $pyStr =
getAttr ($nodeName + ".pythonStringAttr");
If one needs to pass data to other scripts (eg similar to “import myScript”), that data can be stored as attributes as well and queried or set in the python script.
UPDATE: “notes” attributes can store python scripts as well…