NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Support Forum » Python error using urllib2 - need some help
July 11, 2011 by gplouffe |
I have built a 5 segment ledarray powered by the usb port and am experiencing a Python script problem that I need help with. My sign follows a user on twitter and the functionality is split between two pc's. One get the tweets and sends to a website and the other (small fit pc 1 running linux embedded in the led array box via MIFI on Verizon network) gets the text file from the website and pulls down to feed the sign. Problem is that Python throws an error intermittently and I don’t know how to resolve it. Sometimes it will run for 30 min, sometimes an hour or more. I think there may be a timeout with the urllib2 process. I recently added the “ket.setdefaulttimeout(5)” line but it did not help. Any help would be appreciated. I am opened to any other ways of pulling down this text file as well. I have cobbled this code together from other samples and may have done a bad job of it. I am opened to any changes. Thanks. Guy Here is the error..
Here is my code
|
---|---|
July 11, 2011 by gplouffe |
I have done a bit more research, looks like I may be opening too many ports that are not being closed. Will try httplib instead. |
July 11, 2011 by hevans (NerdKits Staff) |
Hi gplouffe, That is likely the issue. Have you tried calling f.close() after you do the f.read(), it might be enough to fix this issue. Humberto |
Please log in to post a reply.
Did you know that two resistors can be used to make a voltage divider? Learn more...
|