Re: Prompting the user for information

Stewart Midwinter <[email protected]>
Newsgroups gmane.comp.python.windows-ce
Message-ID <[email protected]>
On 1/18/06, Joshua Krohse <[email protected]> wrote:
>   If you know the function I am talking about, would you please share it?
> Also, any other methods of prompting for input would be useful.  This would
> be a good topic for a PythonCE Wiki page when there is one.

Joshua, you could try easygui.  It's a GUI tool for getting user input
in non-GUI programs.  It uses Tkinter, but without all of the overhead
you'd normally have.  You just use a one-liner to get the input.

#easygui-example.py
from easygui import *
import sys

while 1:
    msgbox("Hello, world!")
    msg ="What is your favorite flavor?"
    title = "Ice Cream Survey"
    choices = ["Vanilla", "Chocolate", "Strawberry", "Rocky Road"]
    choice = choicebox(msg, title, choices)
    # note that we convert choice to string, in case
    # the user cancelled the choice, and we got None.
    msgbox("You chose: " + str(choice), "Survey Result")
    msg = "Do you want to continue?"


cheers,
--
Stewart Midwinter
[email protected]
[email protected]
Skype, GoogleTalk, iChatAV, MSN, Yahoo: midtoad
AIM:midtoad1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.