Forum: Poser Python Scripting


Subject: is there any simple user input function available ??

jenay opened this issue on Jun 17, 2008 ยท 5 posts


adp001 posted Tue, 17 June 2008 at 7:00 AM

To use Tkinter isn't bad. Try this for a fist start to solve your problem:

from Tkinter import * import tkMessageBox

if tkMessageBox.askyesno(title="My Questiondialog", 
                         message="Please press Yes or No") :
    # YES-Button pressed - we are happy :)
    print "Thanks, you pressed YES"

else :
    # NO-Button pressed or dialog closed
    print "Thanks, you decided to press NO"

Because this simple demo doesn't use a "complete" Tkinter environment, Tkinter sets one up for you. This is the reason for the little extra window that appears if you run the above demonstration.

To learn how to use Tkinter and all the predefined dialogs, learn from the best:

Tkinter: http://effbot.org/tkinterbook/
Dialog-description: http://effbot.org/tkinterbook/tkinter-standard-dialogs.htm

If you have questions, feel free to ask. I'm pretty familar with Python and Tkinter.