Re: [Py2exe-users] Need a bit of TKinter help...
by Jim-On-Linux other posts by this author
Sep 19 2006 9:35PM messages near this date
[Py2exe-users] Need a bit of TKinter help...
|
Re: [Py2exe-users] Need a bit of TKinter help...
On Tuesday 19 September 2006 19:17, you wrote:
> Hey Everybody!
>
> I'm trying to get help as to the use of rapyd
> tk software to create a number speller, but I'm
> having a bit of trouble. I thought posting to
> the Rapyd-tk google group would help, but
> apparently not!
>
> Heres what my message looked like:
>
> Hey,
>
> I have created a simple application with
> rapyd-tk that *should* take a typed in number
> and turn it into a spelled out number (this is
> what the final version should do anyway). Heres
> my problem: I have no clue how to hook up a
> text entry box to a variable (lets say x for
> this example), and have x be parsed into a
> spelled number.
>
> Heres a stupid little command-prompt like
> python program I made before to let you see
> kind of what I mean:
>
> ***********************************************
> ************************************************
> ******** x=int(raw_input("Please Enter An
> Integer Between 0 and 20: ")) if x<0:
> Â Â Â Â print 'Please type a number between 0
> and 20' elif x==0:
> Â Â Â Â print 'Zero'
> elif x==1:
> Â Â Â Â print 'One'
> elif x==2:
> Â Â Â Â print 'Two'
> elif x==3:
> Â Â Â Â print 'Three'
> elif x==4:
> Â Â Â Â print 'Four'
> elif x==5:
> Â Â Â Â print 'Five'
> elif x==6:
> Â Â Â Â print 'Six'
> elif x==7:
> Â Â Â Â print 'Seven'
> elif x==8:
> Â Â Â Â print 'Eight'
> elif x==9:
> Â Â Â Â print 'Nine'
> elif x==10:
> Â Â Â Â print 'Ten'
> elif x==11:
> Â Â Â Â print 'Eleven'
> elif x==12:
> Â Â Â Â print 'Twelve'
> elif x==13:
> Â Â Â Â print 'Thirteen'
> elif x==14:
> Â Â Â Â print 'Fourteen'
> elif x==15:
> Â Â Â Â print 'Fifteen'
> elif x==16:
> Â Â Â Â print 'Sixteen'
> elif x==17:
> Â Â Â Â print 'Seventeen'
> elif x==18:
> Â Â Â Â print 'Eighteen'
> elif x==19:
> Â Â Â Â print 'Nineteen'
> elif x==20:
> Â Â Â Â print 'Twenty'
> elif x>20:
> Â Â Â Â print 'Please type a number between 0
> and 20'
>
> raw_input("Press ENTER To Close Window...")
<
Sorry about the last post. I forgot to include the
global variable, ventry shown below.
## change the ventry variable below to print
written word in vwrite list
ventry = 4 # Global from user input, change
# ventry to test
## -1 produces invalid entry +5 produces error
class Knumbers :
def __init__(self) :
self.Fnum()
def Fnum(self) :
vwrite=
['Zero','one','two','three','four']
x = 0
for txt in vwrite :
if ventry <0 or ventry > 4 :
x= 'invalid entry'
print x
break
if ventry == x :
txt = vwrite[x]
print txt
break
else:
self.x =x =x+1
## you can use self.x or Knumbers.x as your
variable for all Widget Entries where necessary.
You can modify or change as necessary.
jim-on-linux
http:\\www.inqvista.com
>
> ***********************************************
> ****************************
> ***********************
> This was something that I wanted to give a
> gui, where someone could give input through
> means of a text box, and after clicking a spell
> button, the number they entered would be
> converted into spelling. For my gui, i have
> created an interface as seen at
> http://tinyurl.com/r4sby
>
> So, heres what I need help with:
> 1) How do I assign the entry in the text box
> to be a variable?
>
> 2) How do I parse the variable (or determine
> what the user typed, and convert that into text
> like the program I created before)
>
> 3) Off-topic, but is there any way that I can
> prevent the program from showing the python
> command prompt from showing while the program
> is running?
>
> Thanks for any help, I really appreciate it!
>
> FlyingIsFun1217
>
> I wish that I could have gotten some help
> from the people who work more with this, but
> that didn't work, so I'm asking everybody on
> this mailing list: Can you help me with this
> issue?
>
> thanks!
> Tanner
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Py2exe-users mailing list
Py2exe-users@[...].net
https://lists.sourceforge.net/lists/listinfo/py2exe-users
Thread:
Tanner Ruschman
Jim-On-Linux
Jim-On-Linux
|