Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 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.
This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.
I need some help with Python from the gurus here :)
I am just a beginner with Python.
here is a code snippet:
ok = "y"
while ok !="x":
ok = raw_input("... repeat action ...")
print("... do something ...")
print ("... quit ...")
I wrote a simple loop that exits when the "x" is entered. It works fine within
my Python console, but PoserPython refuses to accept the input (raw_input) funktion.
now I didn't find any docu about this matter. seems, that the PoserPython console
doesn't accept any user input ??
do I have to use Tk for that purpose and create a dialog along with buttons - or is
there a simpler solution ???
I found somethong like Poser.dialog - but this seems not available under Poser5 ??