TypeError: write() argument must be str, not dict
hyfc opened this issue · 1 comments
hyfc commented
When I ran the Usage code in README.md, a TypeError occured which refers to this line :
await f.write(self.results)
Then I changed this line to await f.write(self.results['title'])
and everything works just fine.
I noticed that in previous edition of this README file, when aiofile
was not introduced, this part of code used this dict self.results
the same way. So I'm not sure which is the right way to print the result.
elliotgao2 commented
Use await f.write(self.results['title'])
or await f.write(str(self.results))
. I have updated the example.