[phpBB Debug] PHP Notice: in file /viewtopic.php on line 981: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 981: getdate(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
Tynsoe Projects • View topic - Error with python script in geektool

Error with python script in geektool

Error with python script in geektool

Postby mattyi » Sat Feb 12, 2011 10:32 pm

Hi there,

I have a short python script that I want to run in Geektool. It imports the "pywapi" library and runs a command. The code runs cleanly (and returns a result) in the terminal but does not return anything in when I run through Geektool.

I decided to change the pythong script to just one line (printed below) and run in geektool to make sure I could actually call python scripts:

Code: Select all
print 'test'



It ran just fine. Then my plan was to add one line of the original code at a time followed by the print command, and execute via geektool until it failed. It failed after adding the first line:

Code: Select all
import pywapi
print 'test'


It's odd in that the import (and everything else) works fine when I run via terminal but returns nothing when I run in geektool. I was thinking that there was something wrong with the library's installation, but it appears to be fine.

Any thoughts?
mattyi
 
Posts: 3
Joined: Sat Feb 12, 2011 10:09 pm

Re: Error with python script in geektool

Postby mattyi » Sat Feb 19, 2011 9:16 pm

*bump*

Any love?
mattyi
 
Posts: 3
Joined: Sat Feb 12, 2011 10:09 pm

Re: Error with python script in geektool

Postby mattyi » Sun Feb 20, 2011 4:39 pm

Solved! Long story short, I had two python interpreters. When I was installing the pywapi library I also went ahead and updated to python 2.7.

For some reason, using the python command in geektool is still calling the 2.5 interpreter. The pywapi library is installed in 2.7.

So I ran "which python" in the terminal, and it gave me the exact location of the 2.7 interpreter. It yielded this:
Code: Select all
/library/Frameworks/Python.framework/Versions/2.7/bin/python


So, in geektool I called this:
Code: Select all
/library/Frameworks/Python.framework/Versions/2.7/bin/python /users/mattyi/documents/scripts/geektool/CurrentTemp.py


....and it worked!
mattyi
 
Posts: 3
Joined: Sat Feb 12, 2011 10:09 pm

Re: Error with python script in geektool

Postby ybizeul » Sat Apr 02, 2011 8:58 pm

Thank you for reporting
ybizeul
Site Admin
 
Posts: 133
Joined: Fri Jan 22, 2010 4:34 pm


Return to GeekTool

Who is online

Users browsing this forum: No registered users and 7 guests

cron