View Single Post
Old Feb 28th, 2006, 9:38 AM   #12
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Ah, sorry. I missed the fact that num is not global.

You need to define "num" as global in Insert:
def Insert():
             global num
             num += 1
	     input = ent.get()
             ...
This is to tell Python that you want to use the "num" that has a global scope, rather than to create a new variable called "num" local to the function.
Arevos is offline   Reply With Quote