how to print class names, not references
Terry Reedy
tejarex at yahoo.com
Sun Mar 17 22:06:23 EST 2002
More information about the Python-list mailing list
Sun Mar 17 22:06:23 EST 2002
- Previous message (by thread): Hey! This is my new email address.
- Next message (by thread): how to print class names, not references
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"a.clarke11" <a.clarke11 at pop.ntlworld.com> wrote in message news:3C9544B5.47CD0918 at pop.ntlworld.com... > Hi, > I wrote a function of x, where later in the program x is substituted by > class names. In the function, print x is used, but this returns > <__main__.Player instance at 0x38b1ce90> rather than the plain old class > name that I wanted. > How can I print the name instead? grab the string that tells too much: toomuch = str(x). then pull out the part you want -- which is perhaps the definition name between the first '.' and first ' '. Terry J. Reedy
- Previous message (by thread): Hey! This is my new email address.
- Next message (by thread): how to print class names, not references
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list