I might have done it this way.

from samDev.rigging.TOPOCOLAT import (
    config,
    subdivide_curves,
    general,
    circle_config,
    build_body_parts as body
)

And reloaded maybe this way.

for module in (config,
               subdivide_curves,
               general,
               circle_config,
               body):
    reload(module)

​

On 3 August 2016 at 02:34, <[email protected]> wrote:

> On Monday, August 1, 2016 at 3:03:17 PM UTC-7, [email protected] wrote:
> > k thanks Justin.
> >
> > Also say theres a bunch of different modules in one folder. Do i need to
> import each module individually.
> >
> > Or is there a way to just import the folder and access the modules
> individually in the script when theyre needed?
> >
> > thanks,
> > Sam
>
> there's probably a variety of ways to do it.
>
> import os
>
> def moduleList(folder=None):
>
>         modules = []
>
>         folder = os.path.dirname(__file__) if folder is None else folder
>         for (dirpath, dirnames, filenames) in os.walk(folder):
>
>                 modules += [f[:-3] for f in filenames if f.endswith(".py")
> and f != "__init__.py"]
>                 modules += [d for d in dirnames if
> os.path.exists(os.path.join(folder, d, "__init__.py"))]
>                 break
>
>         return sorted(modules)
>
>
> for moduleName in moduleList():
>         __import__(moduleName, globals(), locals(), ["*"], -1)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/0b5b76c6-b401-46b7-979a-0d99dd8a7c2d%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Marcus Ottosson*
[email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCL7Ruqq_HW1OGGkX3%2BTDW1o%3D1xbzmN-SqWZ7gBPYXy2A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to