The type of a tkinter StringVars and IntVars?

B

Bob Greschke

If I have

a = 6

I can do somehting like

if type(a) == int:
Root.bell()

How would I do the same thing if

a = IntVar()
a.set(6)

and then do

if type(a) == IntVar:
Root.bell()

Type() just returns that they are an 'instance'. Is there a way?

Thanks!

Bob
 
S

Steven Bethard

Bob Greschke said:
How would I do the same thing if

a = IntVar()
a.set(6)

and then do

if type(a) == IntVar:
Root.bell()

I don't do much GUI programming, but I believe you're looking for
the 'isinstance' function:
.... pass
....True


Steve
 
B

Bob Greschke

Oooo. You are very smart (and have saved the project :).

Right there on pg 20 of Essential Reference. Tsk tsk tsk on me.

Thanks!!

Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,209
Messages
2,571,088
Members
47,687
Latest member
IngridXxj

Latest Threads

Top