Jump to content

Trying To Import A Python Library


alphaNNN

Recommended Posts

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

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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".

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...