Determining Types

Adonis Vargas deltapigz at telocity.com
Sat Sep 1 13:51:52 EDT 2001


how am i able to determine types of variables? i have come up with the
type() function but am unsuccessful in using it. this is the code in which
im using the provided function:

def convert():
    if type(txth1.get()) == 'int':
        print 'its an int'
    elif type(txth1.get()) == 'str':
        print 'its a string'

any help would be greatly appreciated.

Adonis





More information about the Python-list mailing list