I'm creating a small script to fetch heap memory usage from java-application server. I was able to connect and fetch the data well. However when I try to tidy the output a bit with re-library I get TypeError which confuses me.
TypeError: expected str or unicode but got <type 'javax.management.openmbean.CompositeDataSupport'>
My regex:
re.search(r'\=(.*)$', result)
I tested type of output:
type(result)
Which yields following:
<type 'javax.management.openmbean.CompositeDataSupport'>
Is there anyway I can convert the output to string? str(result) did not work.