> >if D.has_key(event.keysym):
> > str=D[event.keysym]
> >self.text.insert(END,str)
>
> You can remove the 'text.' thats only used if text
> were part of a class, which in this case it isn't.
Oops, that should say remove 'self.' not text.
Alan G.
___
11:51 PM
Subject: Re: [Tutor] Dictionary blues...
My deepest and most sincere apologies - cooking dinner for the family and
posting questions do not mix, I keep making mistakes in the code I type.
Once again my apologies - here's the code as it is in my source:
import sys, os, unicodedat
;p':
str='t'
elif event.keysym=='t':
str='z'
put all the conversion values into a dictionary and make the function use
the key:value pairs from dictionary.
I hope I am making sense.
Igor
- Original Message -
From: "Alan Gauld" <[EMAIL
Igor,
> I posted the wrong code before. The code is:
Is this the actual code you have written? If so it is
so far from being working code that it suggests you
need to back up a little and work at the basics of
Python before trying to tackle Tkinter and GUIs.
I'll assume this really is your co
On Wed, 23 Mar 2005, Igor Riabtchuk wrote:
> I posted the wrong code before. The code is:
>
> from Tkinter import *
>
> D={a:"tom", b:"dick", c:"harry"}
>
> text.bind('', self.Conv)
>
> def Conv(self,event):
> if D.has_key(event.keysym):
> str=D[event.keysym]
> self.text.insert(END
I posted the wrong code before. The code
is:
from Tkinter import *
D={a:"tom", b:"dick", c:"harry"}
text.bind('',
self.Conv)
def Conv(self,event): if
D.has_key(event.keysym):
str=D[event.keysym]
self.text.insert(END,str) return 'break'
The error message says wrong