Convert type() to string?

Robert Oschler Oschler at earthlink.net
Tue Nov 12 18:22:00 EST 2002


I want to be able to print out the type() of a string for a "structure
walker" I'm writing.  I need to be able to prepend a string of pad
characters to the type() so the following:

print padstr + type(x)

won't work because type() does not return a string.  What's a good way to do
this?  I'm using Python 2.1 + Python 2.2 (2.1 for Jython).

thx






More information about the Python-list mailing list