well, in this case you should not use str(). That's not what you want.
From the docs:
see this example
Back to your particular issue... In my code I showed that you need to use
From the docs:
Quote:str() Return a string version of object. If object is not provided, returns the empty string. Otherwise, the behavior of str() depends on whether encoding or errors is given, as follows.
If neither encoding nor errors is given, str(object) returns object.__str__(), which is the “informal” or nicely printable string representation of object. For string objects, this is the string itself. If object does not have a __str__() method, then str() falls back to returning repr(object). If neither encoding nor errors is given, str(object) returns object.__str__(), which is the “informal” or nicely printable string representation of object. For string objects, this is the string itself. If object does not have a __str__() method, then str() falls back to returning repr(object).
see this example
class Foo(): # class with __str__() method not implemented pass class Bar(): # class with __str__() method implemented pass def __str__(self): return 'This is nice representation of Bar instance' if __name__ == '__main__': foo = Foo() bar = Bar() print(foo) print (str(foo)) print (repr(foo)) print(bar) print(str(bar)) print(repr(bar))
Output:<__main__.Foo object at 0x7fea281004e0>
<__main__.Foo object at 0x7fea281004e0>
<__main__.Foo object at 0x7fea281004e0>
This is nice representation of Bar instance
This is nice representation of Bar instance
<__main__.Bar object at 0x7fea28100518>
hope you see the differenceBack to your particular issue... In my code I showed that you need to use
summary
property of the ForecastioDataPoint
object. Strongly encourage you to read the docs of the forecastio package