determining type

Mikael Olofsson mikael at isy.liu.se
Wed Mar 22 18:45:59 CET 2000


You have already gotten an answer from Alex that solves your problem.
However, you did not get any answer to your question:

On 22-Mar-00 sp00fD wrote:
 >  How do I determine if it's a string or int. I've tried:
 >  if type(key) == "<type \'string\'>":
 >  but that doesn't seem to work. How do I do this?

Try this:

if type(key)==type(''):
    ...

Just in case you will need it someday.

/Mikael

-----------------------------------------------------------------------
E-Mail:  Mikael Olofsson <mikael at isy.liu.se>
WWW:     http://www.dtr.isy.liu.se/dtr/staff/mikael
Phone:   +46 - (0)13 - 28 1343
Telefax: +46 - (0)13 - 28 1339
Date:    22-Mar-00
Time:    18:42:32

This message was sent by XF-Mail.
-----------------------------------------------------------------------



More information about the Python-list mailing list