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

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

$
0
0
Hi! I am running a python script that someone else wrote and I keep coming up with a "non-iterable int object" error. This script goes out to reddit on the internet and grabs quotes of the day to display on a 2.7" e-paper display. There's been no problem connecting to the internet. This is a PI0.

The error messages that I'm receiving look as follows:

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_1acerzz HTTP/1.1" 200 13872
INFO:root:None
INFO:root:We got 231 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

These errors are coming from a python script called edify.py. This script is located at github.com\veebch\edify. I am new to raspberrypi and totally new to python. Let me know if you can help.

Thank you most graciously for your audience and assistance,

Tim

Statistics: Posted by metrob0y — Wed Jan 31, 2024 2:24 am — Replies 2 — Views 107



Viewing all articles
Browse latest Browse all 4674

Trending Articles