473,657 Members | 2,423 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

The "real" name

I'm playing with a sudoku GUI...just to learn more about python.

I've made 81 'cells'...actua lly small canvases

Part of my scheme to write the cells (all 81 of them in the gui) to a file (using the the SAVE callback/button), then
restore the gui cells from the contents of the saved file, which depends on knowing the "name" of the cell with the
focus, or one (or more) which have a number.

The print shows .9919624.999031 2, but this nunber (name?) does not work in:

cell-name of cell-.create_text(18 ,18, text = somevar, fill = 'blue' , font = ('arial', 18, 'bold'))

Also, how can I declare a variable outside of the mainloop/callback scheme which would be 'known' to the callbacks?

Thanks,
Norm

Jan 21 '06 #1
5 1873
> Part of my scheme to write the cells (all 81 of them in the gui) to a file (using the the SAVE callback/button), then
restore the gui cells from the contents of the saved file, which depends on knowing the "name" of the cell with the
focus, or one (or more) which have a number.

The print shows .9919624.999031 2, but this nunber (name?) does not work in:

cell-name of cell-.create_text(18 ,18, text = somevar, fill = 'blue' , font = ('arial', 18, 'bold'))
I'm not entirely sure what you are after here. To me it sounds better to
create names like

"cell%i" % row * column

just for the sake of having different names, but store the cell in a
2-dimensional list called e.g. "cells"

Then accessing the cell at x, y is simply

cells[x][y].create_text(.. .)

Does that make sense to you?

Also, how can I declare a variable outside of the mainloop/callback scheme which would be 'known' to the callbacks?


You can of course go for globals. Beside that, a callback can be
anything callable. That means that you can go for something like this:

class StatefulCallabl e(obkect):

def __init__(self, some_state):
self.state = some_state

def __call__(self, *args): # I'm not sure what comes with the callback
print "called with args %r and state %r" % (args, self.state)
Then pass an instance of StatefulCallabl e as callback.

Regards,

Diez
Jan 21 '06 #2
en********@hotm ail.com wrote:
I'm playing with a sudoku GUI...just to learn more about python.

I've made 81 'cells'...actua lly small canvases

Part of my scheme to write the cells (all 81 of them in the gui) to a file (using the the SAVE callback/button), then
restore the gui cells from the contents of the saved file, which depends on knowing the "name" of the cell with the
focus, or one (or more) which have a number.

The print shows .9919624.999031 2, but this nunber (name?) does not work in:

cell-name of cell-.create_text(18 ,18, text = somevar, fill = 'blue' ,font = ('arial', 18, 'bold'))

Also, how can I declare a variable outside of the mainloop/callback scheme which would be 'known' to the callbacks?

Thanks,
Norm

How about using a dict, something like (untested):
cells = {}
for row in range(1, 10):
.. for column in range(1, 10):
.. cells[(row, column)] = canvas() # or whatever you use to create
a canvas

Then, to put a value in a given cell, you simply to
cell[(row, column)].create_text(.. .)

André

Jan 21 '06 #3
en********@hotm ail.com wrote:
I'm playing with a sudoku GUI...just to learn more about python.

I've made 81 'cells'...actua lly small canvases

Part of my scheme to write the cells (all 81 of them in the gui) to a file (using the the SAVE callback/button), then
restore the gui cells from the contents of the saved file, which depends on knowing the "name" of the cell with the
focus, or one (or more) which have a number.

The print shows .9919624.999031 2, but this nunber (name?) does not work in:

cell-name of cell-.create_text(18 ,18, text = somevar, fill = 'blue' , font = ('arial', 18, 'bold'))

Also, how can I declare a variable outside of the mainloop/callback scheme which would be 'known' to the callbacks?

Thanks,
Norm


I guess you are using tkinter.

".9919624.99903 12" in tkinter is just a string representation of the
underlying object, in this case a Canvas(). It is not up to a python
programmer to understand exactly what these numbers are. They are used
by Tcl/Tk internally.

Tk objects are not pickleable. Better is to create a datastructure that
can be pickled from info gleaned specifically with the itemcget()
method. Example code is below. See the Pickle/cPickle documentation.
They are very easy to use.

Since you haven't posted any code, I can only guess what you are doing.
But you may want to try variations on the following (read the comments):

from Tkinter import *

# This is how you may want to make a bunch of canvases in a grid.
def make_canvases(p arent, rows=9, cols=9, **options):
"""
Pass in rows, cols, and any options the canvases should
require.
"""
cells = []
for i in xrange(rows):
arow = []
for j in xrange(cols):
c = Canvas(parent, **options)
c.grid(row=i, column=j)
arow.append(c)
cells.append(ar ow)
return cells

def demo():
"""
Tests out our make_canvases() function.
"""

# tkinter stuff--setting up
tk = Tk()
f = Frame(tk)
f.pack(expand=Y ES, fill=BOTH)

# make the canvases the gui-programmer way
canvases = make_canvases(f , height=25, width=25)

# individual access to canvases (remember that indices start at 0)
canvases[0][0].configure(back ground='orange' )
canvases[7][8].create_text(14 , 8, text='Bob',
fill='blue',
font=('arial', 14, 'bold'))
canvases[8][8].create_text(14 , 8, text='9,9',
fill='blue',
font=('arial', 14, 'bold'))

# accessing inside loops
for i in xrange(9):
canvases[i][8-i].configure(back ground='red')

# fun with bindings (see your last question)
# you should study this one!
for i in xrange(9):
for j in xrange(9):
c = canvases[i][j]
c.bind("<Button-1>",
lambda e=None, c=c: c.configure(bac kground='green' ))

# getting out info
texts = []
for i in xrange(9):
for j in xrange(9):
c = canvases[i][j]
for t in c.find_all():
try:
text = c.itemcget(t, 'text')
texts.append((i ,j,text))
except:
pass

# reporting the got-out info
Label(tk, text="Texts are: %s" % texts).pack(exp and=YES, fill=X)
tk.mainloop()

demo()
Jan 21 '06 #4
On Sat, 21 Jan 2006 14:23:49 -0800, James Stroud <js*****@ucla.e du> wrote:
en********@hot mail.com wrote:
I'm playing with a sudoku GUI...just to learn more about python.

I've made 81 'cells'...actua lly small canvases

Part of my scheme to write the cells (all 81 of them in the gui) to a file (using the the SAVE callback/button), then
restore the gui cells from the contents of the saved file, which depends on knowing the "name" of the cell with the
focus, or one (or more) which have a number.

The print shows .9919624.999031 2, but this nunber (name?) does not work in:

cell-name of cell-.create_text(18 ,18, text = somevar, fill = 'blue' , font = ('arial', 18, 'bold'))

Also, how can I declare a variable outside of the mainloop/callback scheme which would be 'known' to the callbacks?

Thanks,
Norm


I guess you are using tkinter.

".9919624.9990 312" in tkinter is just a string representation of the
underlying object, in this case a Canvas(). It is not up to a python
programmer to understand exactly what these numbers are. They are used
by Tcl/Tk internally.

Tk objects are not pickleable. Better is to create a datastructure that
can be pickled from info gleaned specifically with the itemcget()
method. Example code is below. See the Pickle/cPickle documentation.
They are very easy to use.

Since you haven't posted any code, I can only guess what you are doing.
But you may want to try variations on the following (read the comments):

from Tkinter import *

# This is how you may want to make a bunch of canvases in a grid.
def make_canvases(p arent, rows=9, cols=9, **options):
"""
Pass in rows, cols, and any options the canvases should
require.
"""
cells = []
for i in xrange(rows):
arow = []
for j in xrange(cols):
c = Canvas(parent, **options)
c.grid(row=i, column=j)
arow.append(c)
cells.append(ar ow)
return cells

def demo():
"""
Tests out our make_canvases() function.
"""

# tkinter stuff--setting up
tk = Tk()
f = Frame(tk)
f.pack(expand=Y ES, fill=BOTH)

# make the canvases the gui-programmer way
canvases = make_canvases(f , height=25, width=25)

# individual access to canvases (remember that indices start at 0)
canvases[0][0].configure(back ground='orange' )
canvases[7][8].create_text(14 , 8, text='Bob',
fill='blue',
font=('arial', 14, 'bold'))
canvases[8][8].create_text(14 , 8, text='9,9',
fill='blue',
font=('arial', 14, 'bold'))

# accessing inside loops
for i in xrange(9):
canvases[i][8-i].configure(back ground='red')

# fun with bindings (see your last question)
# you should study this one!
for i in xrange(9):
for j in xrange(9):
c = canvases[i][j]
c.bind("<Button-1>",
lambda e=None, c=c: c.configure(bac kground='green' ))

# getting out info
texts = []
for i in xrange(9):
for j in xrange(9):
c = canvases[i][j]
for t in c.find_all():
try:
text = c.itemcget(t, 'text')
texts.append((i ,j,text))
except:
pass

# reporting the got-out info
Label(tk, text="Texts are: %s" % texts).pack(exp and=YES, fill=X)
tk.mainloop()

demo()


Thanks for your reply, and those of others...all are helpful. As to the code I wrote (so far), her it is, complete with
some expressions that didn't work too well...:)
Thanks....Norm

#======== Start GUI CODE =============== =======

from Tkinter import *
import tkFileDialog

fred = Tk() # Notice I have a bias against 'top', 'master', 'root', etc

fred.title(' SUDOKU SCREEN')
#fred.geometry( '400x400')
#fred.resizable (0,0)

#------------------------------ Declare 9 frames plus one for the buttons

fr1 = Frame(fred); fr2 = Frame(fred); fr3 = Frame(fred)
fr4 = Frame(fred); fr5 = Frame(fred); fr6 = Frame(fred)
fr7 = Frame(fred); fr8 = Frame(fred); fr9 = Frame(fred)
bfr = Frame(fred, relief = 'raised', borderwidth = 1, pady = 10)
#------------------------------ Set some vars

ind = [3,4,5,12,13,14, 21,22,23,27,28, 29,33,34,35,36, 37,38,42,43,44, 45,46,47,51,52, 53,57,58,59,66, 67,68,75,76,77]
fr_list = [fr1,fr2,fr3,fr4 ,fr5,fr6,fr7,fr 8,fr9]
can_list = ['can1','can2',' can3','can4','c an5','can6','ca n7','can8','can 9']
cell = []
myvar = ''
mykey = 'K'
myadd = 'one'
iy = 0

#------------------------------ Create 9 frames with 9 canvases in each

for fitem in fr_list:
for item in can_list:
item = Canvas(fitem, width = 30, height = 30, borderwidth = 1, relief = 'solid')
item.pack(side = LEFT, fill = BOTH)
cell.append([item, iy, '-']) # List of [IDs, 0 to 80, key text]
iy += 1

#------------------------------ Create some supporting (callback) functions

def clr_scrn():
for iz in range(81):
cell[iz][0].delete(ALL)

def hint():
print 'Hint not implemented yet'

def solve():
print 'Solve not implemented yet'

def get_file():
cell_ID = ""
cell_list = []
root = Tk()
root.withdraw() # do this to remove the "blank screen"
filename = tkFileDialog.as kopenfilename()
fp2 = open(filename, 'r+')
for line in fp2:
fp2.close()
def save_file():
cell_num = ""
cell_val = ""
total = ""
iy = 0
root = Tk()
root.withdraw() # do this to remove the "blank screen"
filename = tkFileDialog.as ksaveasfilename ()
fp1 = open(filename, 'w' )
fp1.close()

def mouse_in(event) :
event.widget.co nfig(highlightc olor = 'blue')
event.widget.fo cus_set()
print 'event', event.widget

def see_key(event):
event.widget.de lete(ALL)
if event.keysym in '123456789':
event.widget.cr eate_text(18,18 , text = event.keysym, font = ('arial', 18, 'bold'))
else:
event.widget.cr eate_text(18,18 , text = '', font = ('arial', 18, 'bold'))
#------------------------------ Create some control buttons

b_new = Button(bfr, text = 'NEW', relief = 'raised', command = clr_scrn ).pack(side = LEFT, padx = 10)
b_open = Button(bfr, text = 'OPEN', relief = 'raised', command = get_file ).pack(side = LEFT, padx = 10)
b_save = Button(bfr, text = 'SAVE', relief = 'raised', command = save_file).pack (side = LEFT, padx = 10)
b_clr = Button(bfr, text = 'CLEAR', relief = 'raised', command = clr_scrn ).pack(side = LEFT, padx = 10)
b_hint = Button(bfr, text = 'HINT', relief = 'raised', command = hint ).pack(side = LEFT, padx = 10)
b_solve = Button(bfr, text = 'SOLVE', relief = 'raised', command = solve ).pack(side = LEFT, padx = 10)
b_exit = Button(bfr, text = 'EXIT', relief = 'raised', command = fred.quit).pack (side = LEFT, padx = 10)

#------------------------------ Now pass everything to the packer

for item in fr_list:
item.pack(side = TOP)

bfr.pack(side = TOP) # Don't forget to add the buttons

#------------------------------ Shade the sub-blocks

for ix in ind:
cell[ix][0].config(bg = 'grey')

#------------------------------ Fill in a few cells just for drill

cell[0][0].create_text(18 ,18, text = '3', fill = 'black', font = ('arial', 18, 'bold'))
cell[1][0].create_text(18 ,18, text = '6', fill = 'black', font = ('arial', 18, 'bold'))
cell[2][0].create_text(18 ,18, text = '9', fill = 'black', font = ('arial', 18, 'bold'))
cell[3][0].create_text(18 ,18, text = '7', fill = 'black', font = ('arial', 18, 'bold'))
cell[4][0].create_text(18 ,18, text = '5', fill = 'black', font = ('arial', 18, 'bold'))
cell[5][0].create_text(18 ,18, text = '8', fill = 'black', font = ('arial', 18, 'bold'))
cell[6][0].create_text(18 ,18, text = '4', fill = 'black', font = ('arial', 18, 'bold'))
cell[7][0].create_text(18 ,18, text = '2', fill = 'black', font = ('arial', 18, 'bold'))
cell[8][0].create_text(18 ,18, text = '1', fill = 'black', font = ('arial', 18, 'bold'))
cell[77][0].create_text(18 ,18, text = '5', fill = 'blue' , font = ('arial', 18, 'bold'))
for item in cell:
item[0].bind('<Enter>' , mouse_in)
item[0].bind('<KeyPres s>', see_key)
mainloop()

Jan 21 '06 #5
en********@hotm ail.com wrote:
On Sat, 21 Jan 2006 14:23:49 -0800, James Stroud <js*****@ucla.e du> wrote:

en********@ho tmail.com wrote:
I'm playing with a sudoku GUI...just to learn more about python.

I've made 81 'cells'...actua lly small canvases

Part of my scheme to write the cells (all 81 of them in the gui) to a file (using the the SAVE callback/button), then
restore the gui cells from the contents of the saved file, which depends on knowing the "name" of the cell with the
focus, or one (or more) which have a number.

The print shows .9919624.999031 2, but this nunber (name?) does not work in:

cell-name of cell-.create_text(18 ,18, text = somevar, fill = 'blue' , font = ('arial', 18, 'bold'))

Also, how can I declare a variable outside of the mainloop/callback scheme which would be 'known' to the callbacks?

Thanks,
Norm

I guess you are using tkinter.

".9919624.999 0312" in tkinter is just a string representation of the
underlying object, in this case a Canvas(). It is not up to a python
programmer to understand exactly what these numbers are. They are used
by Tcl/Tk internally.

Tk objects are not pickleable. Better is to create a datastructure that
can be pickled from info gleaned specifically with the itemcget()
method. Example code is below. See the Pickle/cPickle documentation.
They are very easy to use.

Since you haven't posted any code, I can only guess what you are doing.
But you may want to try variations on the following (read the comments):

from Tkinter import *

# This is how you may want to make a bunch of canvases in a grid.
def make_canvases(p arent, rows=9, cols=9, **options):
"""
Pass in rows, cols, and any options the canvases should
require.
"""
cells = []
for i in xrange(rows):
arow = []
for j in xrange(cols):
c = Canvas(parent, **options)
c.grid(row=i, column=j)
arow.append(c)
cells.append(ar ow)
return cells

def demo():
"""
Tests out our make_canvases() function.
"""

# tkinter stuff--setting up
tk = Tk()
f = Frame(tk)
f.pack(expand=Y ES, fill=BOTH)

# make the canvases the gui-programmer way
canvases = make_canvases(f , height=25, width=25)

# individual access to canvases (remember that indices start at 0)
canvases[0][0].configure(back ground='orange' )
canvases[7][8].create_text(14 , 8, text='Bob',
fill='blue',
font=('arial', 14, 'bold'))
canvases[8][8].create_text(14 , 8, text='9,9',
fill='blue',
font=('arial', 14, 'bold'))

# accessing inside loops
for i in xrange(9):
canvases[i][8-i].configure(back ground='red')

# fun with bindings (see your last question)
# you should study this one!
for i in xrange(9):
for j in xrange(9):
c = canvases[i][j]
c.bind("<Button-1>",
lambda e=None, c=c: c.configure(bac kground='green' ))

# getting out info
texts = []
for i in xrange(9):
for j in xrange(9):
c = canvases[i][j]
for t in c.find_all():
try:
text = c.itemcget(t, 'text')
texts.append((i ,j,text))
except:
pass

# reporting the got-out info
Label(tk, text="Texts are: %s" % texts).pack(exp and=YES, fill=X)
tk.mainloop()

demo()

Thanks for your reply, and those of others...all are helpful. As to the code I wrote (so far), her it is, complete with
some expressions that didn't work too well...:)
Thanks....Norm

#======== Start GUI CODE =============== =======

from Tkinter import *
import tkFileDialog

fred = Tk() # Notice I have a bias against 'top', 'master', 'root', etc

fred.title(' SUDOKU SCREEN')
#fred.geometry( '400x400')
#fred.resizable (0,0)

#------------------------------ Declare 9 frames plus one for the buttons

fr1 = Frame(fred); fr2 = Frame(fred); fr3 = Frame(fred)
fr4 = Frame(fred); fr5 = Frame(fred); fr6 = Frame(fred)
fr7 = Frame(fred); fr8 = Frame(fred); fr9 = Frame(fred)


Named references are useleless here, especially since you are putting
these frames into a list later. In fact, you really don't need to create
these frames because you can just use grid() to place your
canvases...exce pt if you want resize behavior.
bfr = Frame(fred, relief = 'raised', borderwidth = 1, pady = 10)
This frame you WILL want a named reference for, because you do adress it
by name later.

#------------------------------ Set some vars

ind = [3,4,5,12,13,14, 21,22,23,27,28, 29,33,34,35,36, 37,38,42,43,44, 45,46,47,51,52, 53,57,58,59,66, 67,68,75,76,77]
fr_list = [fr1,fr2,fr3,fr4 ,fr5,fr6,fr7,fr 8,fr9]
Better is to eliminate the fr# = Frame(fred) code above and replace this
latter line with:

fr_list = [Frame(fred) for i in xrange(9)]
can_list = ['can1','can2',' can3','can4','c an5','can6','ca n7','can8','can 9']
This list is largely unecessary. Can do the same thing with xrange below.
cell = []
myvar = ''
mykey = 'K'
myadd = 'one'
iy = 0

#------------------------------ Create 9 frames with 9 canvases in each

for fitem in fr_list:
for item in can_list:
item = Canvas(fitem, width = 30, height = 30, borderwidth = 1, relief = 'solid')
item.pack(side = LEFT, fill = BOTH)
cell.append([item, iy, '-']) # List of [IDs, 0 to 80, key text]
iy += 1
1. "for item in can_list" could easily be "for item in xrange(9)", this
would allow you to get rid of the can_list altogether, which will make
your code easier to read and maintain.
2. Are you sure you want to re-bind item here?
#------------------------------ Create some supporting (callback) functions

def clr_scrn():
for iz in range(81):
cell[iz][0].delete(ALL)

def hint():
print 'Hint not implemented yet'

def solve():
print 'Solve not implemented yet'

def get_file():
cell_ID = ""
cell_list = []
root = Tk()
root.withdraw() # do this to remove the "blank screen"
filename = tkFileDialog.as kopenfilename()
fp2 = open(filename, 'r+')
for line in fp2:
fp2.close()
def save_file():
cell_num = ""
cell_val = ""
total = ""
iy = 0
root = Tk()
root.withdraw() # do this to remove the "blank screen"
filename = tkFileDialog.as ksaveasfilename ()
fp1 = open(filename, 'w' )
fp1.close()
Instantiating another Tk here can cause difficut to track-down problems
and erratic behavior if another Tk is already instantiated. Are you sure
you want to do this? You do not want 2 Tk's!!
def mouse_in(event) :
event.widget.co nfig(highlightc olor = 'blue')
event.widget.fo cus_set()
print 'event', event.widget

def see_key(event):
event.widget.de lete(ALL)
if event.keysym in '123456789':
event.widget.cr eate_text(18,18 , text = event.keysym, font = ('arial', 18, 'bold'))
else:
event.widget.cr eate_text(18,18 , text = '', font = ('arial', 18, 'bold'))
Why are you re-binding event.keysym here? Clearer would be just binding
the name keysym. You may not want to mess with event in this case
because this event may get intercepted by another callback, etc.

def see_key(event):
event.widget.de lete(ALL)
if keysym in '123456789':
event.widget.cr eate_text(18,18 , text = keysym,
font = ('arial', 18, 'bold'))
else:
event.widget.cr eate_text(18,18 , text = '',
font = ('arial', 18, 'bold'))

Note: these can now use the make_text() function below.

#------------------------------ Create some control buttons

b_new = Button(bfr, text = 'NEW', relief = 'raised', command = clr_scrn ).pack(side = LEFT, padx = 10)
b_open = Button(bfr, text = 'OPEN', relief = 'raised', command = get_file ).pack(side = LEFT, padx = 10)
b_save = Button(bfr, text = 'SAVE', relief = 'raised', command = save_file).pack (side = LEFT, padx = 10)
b_clr = Button(bfr, text = 'CLEAR', relief = 'raised', command = clr_scrn ).pack(side = LEFT, padx = 10)
b_hint = Button(bfr, text = 'HINT', relief = 'raised', command = hint ).pack(side = LEFT, padx = 10)
b_solve = Button(bfr, text = 'SOLVE', relief = 'raised', command = solve ).pack(side = LEFT, padx = 10)
b_exit = Button(bfr, text = 'EXIT', relief = 'raised', command = fred.quit).pack (side = LEFT, padx = 10)
Things like this are much better written:
def button_row(pare nt, individual_opts , **options):
for text, command in button_opts:
Button(parent, text=text,
command=command ,
**options).pack (side = LEFT, padx = 10)

button_opts = (('NEW', clr_scrn),
('OPEN', get_file),
('SAVE', save_file),
('CLEAR', clr_scrn),
('HINT', hint),
('SOLVE', solve),
('EXIT', fred.quit))

button_row(bfr, button_opts, relief='raised' )
#------------------------------ Now pass everything to the packer

for item in fr_list:
item.pack(side = TOP)

bfr.pack(side = TOP) # Don't forget to add the buttons

#------------------------------ Shade the sub-blocks

for ix in ind:
cell[ix][0].config(bg = 'grey')

#------------------------------ Fill in a few cells just for drill

cell[0][0].create_text(18 ,18, text = '3', fill = 'black', font = ('arial', 18, 'bold'))
cell[1][0].create_text(18 ,18, text = '6', fill = 'black', font = ('arial', 18, 'bold'))
cell[2][0].create_text(18 ,18, text = '9', fill = 'black', font = ('arial', 18, 'bold'))
cell[3][0].create_text(18 ,18, text = '7', fill = 'black', font = ('arial', 18, 'bold'))
cell[4][0].create_text(18 ,18, text = '5', fill = 'black', font = ('arial', 18, 'bold'))
cell[5][0].create_text(18 ,18, text = '8', fill = 'black', font = ('arial', 18, 'bold'))
cell[6][0].create_text(18 ,18, text = '4', fill = 'black', font = ('arial', 18, 'bold'))
cell[7][0].create_text(18 ,18, text = '2', fill = 'black', font = ('arial', 18, 'bold'))
cell[8][0].create_text(18 ,18, text = '1', fill = 'black', font = ('arial', 18, 'bold'))
cell[77][0].create_text(18 ,18, text = '5', fill = 'blue' , font = ('arial', 18, 'bold'))

Again, use a loop and functions (approximately the same amount of typing
but 1000 times more reusability):
def make_text(acell , t, font=('arial', 18, 'bold'),
fill='black', **options):
acell.create_te xt(18,18, text=t, font=font, fill=fill, **options)

def fill_cells(cell s, numbers)
for (c,t) in zip(range(9)), numbers[:-1]):
make_text(cell[c][0], t)
make_text(cell[77][0], text=numbers[-1], fill='blue')

numbers = '3697584215'

fill_cells(cell , numbers)
Notice how this makes filling numbers super easy, e.g.:
fill_cells(cell , '9283571649')

for item in cell:
item[0].bind('<Enter>' , mouse_in)
item[0].bind('<KeyPres s>', see_key)
mainloop()

James

Jan 22 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3131
by: Silas | last post by:
Hi, I use view to join difference table together for some function. However, when the "real" table fields changed (e.g. add/delete/change field). The view table still use the "old fields". Therefore everytimes when I change the real table, I also needed open the view table and save it by SQL enterprise manager manually for update the view table field.
2
1662
by: sandman | last post by:
I created an ImageList in the .NET Designer. Now I can't figure out where the images are located. Where is all this stuff stored and how do I read it? (me personally, I mean -the computer is doing it just fine.) sandman *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
0
1072
by: Simon Verona | last post by:
I have some Windows Forms software that I'm developing that uses a remote server (called using remoting) to provide the business rules and dataaccess. For development purposes the client and server portions are both running on my PC. I was wondering if there was some way that for "real world" performance, I could somehow "throttle" the tcp/ip stack so that calls to localhost had some lag to represent the latency/bandwidth of a real...
0
393
by: David Garamond | last post by:
I want to know how functional indexes are used "in the real world". Here are the common uses: * non-unique index on the first parts of a longish text field (SUBSTRING(field)) to save disk space, while still allowing faster searches than a sequential scan. * indexing on LOWER(field)/UPPER(field) to allow case-insensitive searches or case-insensitive unique constraint.
5
39872
by: playagain | last post by:
Please help me to build a list of examples of stack and queue in real life situation... Conditions: The object concerned must only one object. And the object must be tangible. Example: Queue (FIFO): The bullet in a machine gun..(you cannot fire 2 bullets at the same time) Stack (LIFO): The tennis balls in their container.. (you cannot remove 2 balls at the same time)
1
3120
by: Tyno Gendo | last post by:
Hi everyone I need to move on a step in my PHP... I know what classes are, both in PHP4 and 5 and I'm aware of "patterns" existing, but what I'm looking for are some real world projects eg. Open Source that people consider to use classes and patterns correctly. I lack a senior person to lead me in this so I feel I'm losing out on only using bare PHP class features and not really knowing how to design
3
1753
by: Mark Shroyer | last post by:
I guess this sort of falls under the "shameless plug" category, but here it is: Recently I used a custom metaclass in a Python program I've been working on, and I ended up doing a sort of write-up on it, as an example of what a "real life" __metaclass__ might do for those who may never have seen such a thing themselves. http://markshroyer.com/blog/2007/11/09/tilting-at-metaclass-windmills/ So what's the verdict? Incorrect? Missed the...
71
3285
by: Jack | last post by:
I understand that the standard Python distribution is considered the C-Python. Howerver, the current C-Python is really a combination of C and Python implementation. There are about 2000 Python files included in the Windows version of Python distribution. I'm not sure how much of the C-Python is implemented in C but I think the more modules implemented in C, the better performance and lower memory footprint it will get. I wonder if it's...
7
2403
by: Robert | last post by:
Thanks George, I really am grateful for attempts to be helpful, but this really doesn't answer the question in my OP. What I am looking for is an explanation of WHY things are this way (I was not looking for a work-around). Again, I am appreciative of the feedback. I will note, that even though I can use Interfaces, the calling application and the dynamically loaded assembly both need compile-time refrences to the assembly that...
0
8394
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8306
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8825
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6164
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4152
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.