[Toolserver-l] Scheduling a pywikipedia bot

DeltaQuad deltaquad at live.ca
Fri Apr 22 17:32:02 UTC 2011


>> I get the error:
>> import wikipedia
>> ImportError: No module named wikipedia

>What are you using to "schedule" the bot? cron? You probably just need to
set your PYTHONPATH somewhere.
>For pywikipedia, this means that if your pywikipedia directory is at
/home/user/scripts/pywikipedia, you'd put something like this in cron:
>0 1 2 3 4 PYTHONPATH=$HOME/scripts/pywikipedia python $HOME/vandalize.py
>If you're using qsub, you can set PYTHONPATH in an .environment file in
your home directory.
>There might be a purely Pythonic way to do this as well. Just google around
a bit and you should be able to figure it out.
>MZMcBride

The Python way is:
import sys
#sys.path.append("C:\\pywikipedia\\") #Microsoft Windows
#sys.path.append("/home/deltaquad/pywikipedia/pywikipedia") #Toolserver
And I forget linux off the top of my head, but it's similar, just remove the
first # on the one that applies to you.

--------------------------
DeltaQuad
http://enwp.org/User_Talk:DeltaQuad




More information about the Toolserver-l mailing list