I have GeekTool for Lion and am trying to run the Glet located at - http://www.macosxtips.co.uk/geeklets/messaging/latest-tweet-1/

On my system. It's just not working. The same code is running perfect in terminal and IDLE, but GeekTool is not processing it. I thought it might be a problem with Geektool and Python, but another python script, used to pull the latest XKCD is working perfect on GeekTool (http://code.google.com/p/geektool-xkcd/source/browse/trunk/xkcd.py)

I thought it must be a problem with indentation etc but that's not the case. I've brought the code down to the following, it works in terminal but not with Geektool -

#!/usr/bin/env python
import tweepy

ACCESS_KEY = '...'

auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)
api = tweepy.API(auth)

tested = api.home_timeline()
for result in tested:
    print result.text + '\n' + '\n- ' + result.user.screen_name

I'm not sure at all what the issue is. How do I know that the code is not working? I added the Display Status feedback message icon on the GLet. It keeps glowing red (while the XKCD one is green). If I change the command in the same GLet to something simple like - echo "hello" or python -c print "Hello" then it works fine (glows green, shows output) but as soon as I change it back to the old one, problem!

Also, another doubt - the python -c print command doesn't print anything in the terminal. What's the issue with that? Can someone else please run it and tell me how to print in terminal using python?

  • Post the command of how you are calling the script in geektool, and is that the entire script? It looks like part of it is missing. – l'L'l Oct 17 '11 at 9:12
  • This is the full script. I modified the original one and put this up. It works in terminal. To call it from Geektool, I simply added a command gooklet from GeekTool 3 (the MacAppStore version) and gave it the command - python /Users/<my_user_name>/Documents/GeekTweep.py (that's what I call the python file). Another file in the same directory is called the same way, runs the XKCD script and is working. – Nitin Khanna Oct 17 '11 at 22:23

You must log in to answer this question.

Browse other questions tagged .