Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8578569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:25:15+00:00 2026-06-11T20:25:15+00:00

I have been playing with Python and geektools and I had the script working

  • 0

I have been playing with Python and geektools and I had the script working before I tided up the code and used loops.

Now it will not display anything past the lalala method.

I am working on mac 10.8.1 with geektools 3.0.2.

#!/usr/bin/python

#Simple script that downloads runescape adventures log
#and outputs it to console
# Ashley Hughes 16/SEP/2012

import sys
import urllib2 #For HTTP access
from time import localtime, strftime #Time data functions
from xml.dom.minidom import parseString #XML parser

def lalala(n):
    i = 0
    while(i <= n):
        xmlTag = dom.getElementsByTagName('description')[i].toxml()
        xmlData = xmlTag.replace('<description>','').replace('</description>','').replace('\t','').replace('\n','')
        #print (str(i) + ": " + xmlData)
        print(xmlData)
        i = i + 1

try:
    f = urllib2.urlopen("http://services.runescape.com/m=adventurers-log/rssfeed?searchName=SIG%A0ZerO")
    #f = urllib.urlopen("http://www.runescape.com/")
except Exception, e:
    print "Could not connect"
    sys.exit(1)
s = f.read()
f.close()

dom = parseString(s)

print strftime("%a, %d %b %Y %H:%M:%S", localtime())
print "Working"
lalala(6)
print "Still working"
sys.exit(0)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T20:25:16+00:00Added an answer on June 11, 2026 at 8:25 pm

    You have an unicode-ascii problem when your code is ‘printing’ to GeekTool. Change:

    xmlTag = dom.getElementsByTagName('description')[i].toxml()
    

    to this:

    xmlTag = dom.getElementsByTagName('description')[i].toxml().encode('ascii', 'ignore')
    

    this is fine for me in mac 10.8.1 with GeekTool 3.0.3

    Look at http://docs.python.org/howto/unicode.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been playing with Google maps I had it working but when I
While I have been playing with Python for a few months now (just a
I have been playing around with some Python now and start to get a
I have been playing around with Python and math lately, and I ran in
I've been playing with Python and I have this list that I need worked
I have been playing with Yii for a couple of months now, and to
I have been playing around with Google Apps Script today and I am trying
I have been playing around with NSURLConnection. Now I'm trying to grab some data
I'm learning Python and I have been playing around with packages. I wanted to
I am new to python and have been working through the examples in Swaroop

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.