Re: [Maya-Python] GUI Help! Python in maya

33 views
Skip to first unread message
Message has been deleted

Justin Israel

unread,
May 3, 2014, 5:26:54 PM5/3/14
to python_in...@googlegroups.com

Are there multiple people doing this Towers of Hanoi thing on this list? :-)

Are you saying you have defined your code like this?

def Hanoi():
    def solve_hanoi():
       ...

If so, don't do that. Refactor your code to have reusable logic by putting solve_hanoi() in a scope that can be reached by a button callback

Otherwise you will need to show some code, because it is hard to know what you are doing from a vague description.

On May 4, 2014 7:05 AM, "Heather Rose" <ameli...@hotmail.co.uk> wrote:
Hi Guys,

I am trying to create a GUI in python in maya for my Towers of Hanoi Solver. I have made GUIs before but the difference now is that all of my procedures are within another procedure!

So say I wanted to make a button that solved the puzzle. I have a function, def solve_hanoi(disc, 1, 2, 3):, which solves the puzzle. This function is within def Hanoi():, so when i'm making my button:

cmds.button("Solvepuzzle", l="Solve the Puzzle", w=200, al="center", command=?)

What should the command be?!

Thanks in advance! 


--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/51666336-f3f0-46b2-b77f-b5ed3a0bef42%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matt Estela

unread,
May 3, 2014, 7:58:09 PM5/3/14
to python_in...@googlegroups.com

Uni assignment perhaps? My gut reaction is to call 'cheat', but if I were asked to solve the towers of Hanoi puzzle for work, I'd consult this list too. :)

Reply all
Reply to author
Forward
0 new messages