Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4151

Troubleshooting • TypeError, Non-iterable int Object..... Reddit Quotes

$
0
0
Hi! Does anyone know what my Pi0 might be trying to tell me after unsuccessfully running my python script? The error message follows this:

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): www.reddit.com:443
DEBUG:urllib3.connectionpool:https://www.reddit.com:443 "GET /r/quotes/top/.json?t=month&limit=100&after=t3_19fm5j7 HTTP/1.1" 200 15041
INFO:root:None
INFO:root:We got 222 quotes.
cannot unpack non-iterable int object
ERROR:root:cannot unpack non-iterable int object
cannot unpack non-iterable int object Line: 380
Traceback (most recent call last):
File "/home/genevieve/edify/edify.py", line 300, in redditquotes
img, numline =writewrappedlines(img,quote,fontsize,y_text,height, width,fontstring)
File "/home/genevieve/edify/edify.py", line 125, in writewrappedlines
_place_text(img, line,0, y_text, fontsize,fontstring)
File "/home/genevieve/edify/edify.py", line 112, in _place_text
text_width, = font.getbbox(text)[2]
TypeError: cannot unpack non-iterable int object[/size][/siz
e]

If you want to read the full python script, it is out on github.com/veebch/edify. This python script goes out to reddit and grabs the latest "quotes for the day" and then displays them on a 2.7 e-paper hat.

I am totally new to pi0 and python. Any help you can give me I will be thankful for!

Tim

Statistics: Posted by metrob0y — Sun Jan 28, 2024 8:57 pm



Viewing all articles
Browse latest Browse all 4151

Trending Articles