Maya - How to create python scripts with more than one file?
Question: It's my first post here, please understand that I'm a beginner and that I'm
learning "on-the-job".

Can someone explain how can I import files from a different module in a Maya
python script? I'm getting the following error:

    
    
    Error: ImportError: file E:/.../bin/mainScript.py line 17: No module named tools
    

Here are my directories and codes:

    
    
    Main_folder\
    |-- install.mel
    |-- ReadMeFirst.txt
    `-- bin\
        |-- __init__.py
        |-- mainScript.py
        |-- tools.py
        `-- presets\
            |-- bipedPreset.txt
            |-- quadrupedPreset.txt
            `-- [...] .txt
    

I'm trying to import `tools.py` in `mainScript.py`

### EDIT:

Ok, as it won't fit in a comment I edit this post to add precisions. I moved
the 'Main_folder' on my Desktop and ran the script once again in Maya. It
still doesn't work but I have a more complete error traceback. Here it is:

    
    
    # Error: Error in  maya.utils._guiExceptHook:
    #   File "C:\Program Files\Autodesk\Maya2014\Python\lib\site-packages\maya\utils.py", line 332, in formatGuiException
    #     result = u'%s: file %s line %s: %s' % (exceptionType.__name__, file, line, exceptionMsg)
    # UnicodeDecodeError: 'ascii' codec can't decode byte 0xfc in position 11: ordinal not in range(128)
    # 
    # Original exception was:
    # Traceback (most recent call last):
    #   File "<maya console>", line 3, in <module>
    #   File "C:/Users/UKDP/Desktop/Main_folder/bin/mainScript.py", line 17, in <module>
    #     from tools import ClassTest
    # ImportError: No module named tools # 
    


Answer: Try importing like:

    
    
    >>>import san.libs.stringops
    
    Where the san is dir(in san create __init__.py)
    libs is a dir(in libs create __init__.py) 
    and stringops.py is imported 
    

