Re: Raspberry pi: TypeError: 'int' object is not callable 01.26.2018 01:08 PM
From the import statements in your code, I see you're using the DHT11 Python library.
I presume the TypeError you've encountered is triggered by this line:
temp = result.temperature()
According to the DHT11 documentation, temperature is an attribute rather than a function. Thus the parentheses after temperature, are causing the error as Python is attempting to call the temperature function - however no such function exists. There is only the temperature attribute.
To obtain the temperature attribute you should change the offending line as follows:
temp = result.temperature
In the future it would be helpful if you included the entire traceback of your error message as this includes the line number where the error occurred, which makes it much easier to troubleshoot.
Additionally, providing your source via a code snippet sharing service such as GitHub's Gist would also be helpful, as the code will then include line numbers & formatting based on the language being used (e.g. Python). Here's a helpful article on creating Gists, once you've created the Gist you can then copy the URL for sharing.