Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Anyone running Python scripts?

  1. #1
    Junior Member
    Join Date
    Apr 2004
    Posts
    9

    Question Anyone running Python scripts?

    Hi,

    I noticed that Python is installed on the servers, but I don't manage to run a test script like this one:

    #! /usr/bin/python
    print "Content-Type: text/plain\n\n"
    print "Hello, Python"

    I get a "500 Internal Server Error" message...

    Anyone running Python scripts here?

    Thnx,
    Maqueo

  2. #2
    Junior Member
    Join Date
    Apr 2004
    Posts
    9

    Default PS

    PS:

    The test file is saved as test.py and at http://www.mydomain.com/cgi-bin/test.py when I try to run it

  3. #3
    Senior Member
    Join Date
    Mar 2004
    Location
    California
    Posts
    724

    Default

    I'm running the Mailman script, which is a python script. It works fine, but it self-installs from Cpanel so I'm afraid I don't know anything about python itself.

  4. #4
    Senior Member Buddha's Avatar
    Join Date
    Mar 2004
    Location
    Florida USA
    Posts
    825

    Default

    Just some thoughts:

    • Was the file uploaded in ASCII?
    • File permission allowing execution?
    • That shebang (#!) is on the first lines and does starts on the first character?
    "Whatcha mean I shouldn't be rude to my clients?! If you want polite then there will be a substantial fee increase." - Buddha

  5. #5
    Junior Member
    Join Date
    Apr 2004
    Posts
    9

    Default

    Hi,

    Yes, I'm running the mailing lists scripts as well, and I found the path to the Python bin in a post in this forum. It seems Python is usually installed w/ Apache, but most host don't even mention it.

    Yes, the file was in ASCII (written in Notepad), #! is at the top and rights were set to 755.

    Cheers,
    M.

  6. #6
    Senior Member Buddha's Avatar
    Join Date
    Mar 2004
    Location
    Florida USA
    Posts
    825

    Default

    Quote Originally Posted by Maqueo
    Hi,
    Yes, the file was in ASCII (written in Notepad)...
    Maybe I picked the wrong word. Anyway, that's not the same as uploading it as text and not binary.
    "Whatcha mean I shouldn't be rude to my clients?! If you want polite then there will be a substantial fee increase." - Buddha

  7. #7
    Junior Member
    Join Date
    Apr 2004
    Posts
    9

    Default

    Quote Originally Posted by Buddha
    Maybe I picked the wrong word. Anyway, that's not the same as uploading it as text and not binary.
    I uploaded it the with the same FTP client I up my PHP scripts with, so that shouldn't be the problem right?

    I'll double checklater when I get home though, try some other stuff. Maybe upload a Perl script to the bin just to be sure.

  8. #8
    Senior Member Buddha's Avatar
    Join Date
    Mar 2004
    Location
    Florida USA
    Posts
    825

    Default

    Quote Originally Posted by Maqueo
    I uploaded it the with the same FTP client I up my PHP scripts with, so that shouldn't be the problem right?

    I'll double checklater when I get home though, try some other stuff. Maybe upload a Perl script to the bin just to be sure.
    Yep it might. If the FTP client doesn't know .py is text and not binary that's could be the problem. WS_FTP defualts to binary when it doesn't recognize a file extension.
    "Whatcha mean I shouldn't be rude to my clients?! If you want polite then there will be a substantial fee increase." - Buddha

  9. #9
    Junior Member
    Join Date
    Apr 2004
    Posts
    9

    Default Hello World :)

    Hi Buddha,

    I got it running!

    Solution was to rename *.py to *. or *.pl One of those "DUH" moments

    I guess Python is installed but the extensions are not configured. This should be fun, I've just started to look into Python, but so far I really really like it...

    Anyways, thanks again!

    Maqueo

    PS: Reg that bill... send it to my nigerian address, please include your bank account number and all your personal info. You'll be handsomely rewarded hehehe

  10. #10
    Member
    Join Date
    Mar 2004
    Posts
    99

    Default

    PS: Reg that bill... send it to my nigerian address, please include your bank account number and all your personal info. You'll be handsomely rewarded hehehe
    LMAO That was pretty damn funny Maqueo!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •