Python paths question

Python paths question

FalconCrest
Advisor Advisor
755 Views
2 Replies
Message 1 of 3

Python paths question

FalconCrest
Advisor
Advisor

Correct me if I'm wrong, if you have a python script in a sub-folder of a custom Maya Path and in that sub-folder you include the __init__.py file, the script should work, correct ?

 

Or if there are multiple sub-folders, the last sub-folder should include the __init__.py file ?

0 Likes
756 Views
2 Replies
Replies (2)
Message 2 of 3

zhong_wu
Autodesk Support
Autodesk Support

I am not a python expert, but according to my knowledge, __init__.py is used to make the folder to be a package, it seems quite different as what you want.

 

To make your python script work, you can add the Maya custom path into the sys.path or PYTHONPATH. 

 


John Wu
Developer Technical Services
Autodesk Developer Network


0 Likes
Message 3 of 3

FalconCrest
Advisor
Advisor
I was informed otherwise, as long as the __init__.py file is located within the sub-folder, Maya should read the script located in the sub-folder ?
0 Likes