Jump to content

Recommended Posts

Posted

I followed the directions to run python scripts on this forum and i have a question that maybe someone can answer.

 

I uploaded a file like this:

 

 

>#!/usr/bin/python

print 'Content-type: text/html'
print
print 'This is a test'
print 'This is a 2nd test'

 

 

Set my permissions and it runs fine.

 

But if I upload a file that has this, it does not work (500 Internal Server Error):

 

>#!/usr/bin/python

print 'Content-type: text/html'
print
print 'This is a test'
print 'This is a 2nd test'

def main()
print 'This is another test'

main()

 

 

Notice the tab and function? am I missing something?

 

Thanks...perplexed

Posted

Sorry, I'm being *#$# #$#$#...

 

It was the

 

def main()

 

needed to be:

 

def main():

 

 

I have been being tortured with too much vb6....please forgive.

 

- JM

Posted

Glad you were able to sort it out, I know I have that problem all the time. It took me forever the other day to realize that I had some how used (s) instead of ($) in front of a php variable. Really not sure how I got crossed eyed enough to do that, since they are no where near each other on the KB. :)

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...