In Python, importing a script is the same as running it.

To list a series of scripts, you can simply list the directory in which
they lie, and then run them by importing them. You can programmatically
import a module using __import__("hand script.py"). An alternative to
importing is execfile which is similar, but doesn’t require that you expose
a directory via sys.path first.

import os
for script in os.listdir("."):
  __import__(script)

​

On 27 December 2015 at 09:49, Rudi Hammad <[email protected]> wrote:

> Hello,
> I have no idea how to do that. I have uploaded an image to explain it.
> I want to create a stack of scripts and execute them in order. I want to
> be able to add and delete them dynamically , and even save a preset of the
> stack I made to be able to load it later for another character.
>  I used the listWidget but I don´t think that works
> Any guidance to know were should I start? Because right now I am lost.
> thanks
>
> --
> 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/e5cc06d4-59ae-4f2c-9bd2-8096f93c32c1%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/e5cc06d4-59ae-4f2c-9bd2-8096f93c32c1%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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/CAFRtmODg8g90Zejuo-7Os_7uSsuLOgmrofo8jREAGa9674G2Vw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to