I just thought for one second that a pre-import def could be worth annd didn´t
know wich way to go..
Totally agree with your explanations guys, Thanks a lot for the infos!

cheers

On Fri, Aug 5, 2011 at 1:57 PM, ArrantSquid <[email protected]> wrote:

> Keep it simple and standard. Importing modules like that is going to
> import extraneous modules and stuff you really aren't going to need.
> When in doubt look to PEP 8
>
> http://www.python.org/dev/peps/pep-0008/
>
>
>
> On Aug 5, 12:26 pm, Renato Polimeno <[email protected]> wrote:
> > Hey guys, I´m starting digging out some python codes and I´m testing out
> my
> > own def to 'batch import' necessary modules... ie.
> >
> > def importModule(modules):
> >     try:
> >         for mod in modules:
> >             module = __import__(mod)
> >             for d in module.__dict__:
> >                 print 'module= ', mod, 'dict=', d, '\n'
> >     #
> >     except ImportError:
> >         print "Unable to import %s" % (modules)
> >     #
> >
> > Using importModule(["maya.cmds","pymel.core"]) works fine.. But how could
> I
> > implement a list of strings more efficient like "import maya.cmds as
> cmds"
> > or "from pymel.core import *" ?
> > Do you guys use something like this or is it better to keep it simple and
> > standard?
> >
> > Thanks,
> >
> > --
> > ______________________________
> >
> > -> Renato Polimeno
> > +55 11 7539 3615
> > renatopolimeno.com <http://www.renatopolimeno.com>
> >  <http://www.renatopolimeno.com/>facebook.com/renato.polimeno<
> http://www.facebook.com/renato.polimeno>
> > @renatopolimeno <http://www.twitter.com/renatopolimeno>
>
> --
> view archives: http://groups.google.com/group/python_inside_maya
> change your subscription settings:
> http://groups.google.com/group/python_inside_maya/subscribe
>



-- 
______________________________

-> Renato Polimeno
+55 11 7539 3615
renatopolimeno.com <http://www.renatopolimeno.com>
 
<http://www.renatopolimeno.com/>facebook.com/renato.polimeno<http://www.facebook.com/renato.polimeno>
@renatopolimeno <http://www.twitter.com/renatopolimeno>

-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe

Reply via email to