Thursday 2 May 2019

python - Compare type of a variable

I have a variable x and whose type is :




type(x)
>>


in the next part, I want to see if the type of x is
I am unable to compare and see it
So far, I have tried:



if type(x) == "__main__.XmlListConfig":



This does not work because ofcourse I am comparing it to a string.
Any Suggesting will help and please feel free to ask me for more clarification.

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...