[Toolserver-l] Re : Scheduling a pywikipedia bot

Marcin Cieslak saper at saper.info
Sun Apr 24 20:26:19 UTC 2011


>> Grimlock <grimlockfr at yahoo.fr> wrote:
> Doing a sys.path.append(whatever) is uneffective when you have to schedule a 
> python work (I tested it yersteday).
> The issue that Junaid indicated and the answer given is, in my mind, the only 
> one for the moment.

Here's what I did:

willow$ head test/test.py lib/testlibrary.py
==> test/test.py <==
#! /usr/bin/env python
import sys, os
sys.path.append(os.environ["HOME"] + "/lib")
import testlibrary
testlibrary.something()

==> lib/testlibrary.py <==
def something():
        print "Just done!"


willow$ chmod a+x test/test.py
willow$ qsub test/test.py
Your job 354713 ("test.py") has been submitted
willow$ cat test.py.o354713
Just done!

Seems to be working fine...

//Marcin




More information about the Toolserver-l mailing list