Jump to content

Recommended Posts

Posted

Johnny. I have no idea what Python version, probably the default one. Since I have your attention: how do I schedule the execution of py scripts? Do you provide something similar to cron jobs?

Posted

Users are allowed to use cron http://johnny.heliohost.org:2082/frontend/x3/cron/index.html Please do not ignore the bold red text though. Each user can run a maximum of two cron jobs per day, and if you exceed this limit your account will be suspended.

 

Here are the versions of python currently available on Johnny:

#!/usr/bin/python2.4
Python 2.4.3

#!/usr/bin/python
Python 2.4.3

#!/usr/local/bin/python2.7
Python 2.7.4

Posted

I'm trying to import a Python lib (praw) from a subdirectory. It works fine on my test machine, but not on Johnny. I'm using the exact same directory structure, with the praw directory (which contains the __init__.py) as a subdir. Since we don't have console access I'm not sure how to troubleshoot this.

 

#!/usr/local/bin/python2.7
from datetime import datetime
from praw import Reddit

print("content-type: text/html\n\n")
print(datetime.today().day)

Posted

Try:

import sys
sys.path.append("/home/<user>/path/to/praw")
import praw

Posted

Didn't work.

 

 

#!/usr/local/bin/python2.7

import sys
sys.path.append("/home/<my username>/public_html/cgi-bin/praw")
import praw

from datetime import datetime

print("content-type: text/html\n\n")
print(datetime.today().day)

 

Always hangs up on "import praw".

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...