Junaid P V wrote:
I am trying to schedule a pywikipedia bot, but could not do it..
I get the error: import wikipedia ImportError: No module named wikipedia
How can I specify working directory for the program. I googled and tried several arguments but not worked. (It is first time I try to schedule a job)
Could someone help me?
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