Trying To Run Python Script

liunx

Guest
I followed the directions to run python scripts on this forum and i have a question that maybe someone can answer.<br /><br />I uploaded a file like this:<br /><br /><br /><div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>#!/usr/bin/python<br /><br />print 'Content-type: text/html'<br />print<br />print 'This is a test'<br />print 'This is a 2nd test'<br /></div><br /><br /><br />Set my permissions and it runs fine.<br /><br />But if I upload a file that has this, it does not work (500 Internal Server Error):<br /><br /><div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>#!/usr/bin/python<br /><br />print 'Content-type: text/html'<br />print<br />print 'This is a test'<br />print 'This is a 2nd test'<br /><br />def main()<br />print 'This is another test'<br /><br />main()<br /></div><br /><br /><br />Notice the tab and function? am I missing something? <br /><br />Thanks...perplexed<!--content-->
Sorry, I'm being *#$# #$#$#...<br /><br />It was the <br /><br />def main()<br /><br />needed to be:<br /><br />def main():<br /><br /><br />I have been being tortured with too much vb6....please forgive.<br /><br />- JM<!--content-->
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. <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/blink.gif" style="vertical-align:middle" emoid=":blink:" border="0" alt="blink.gif" /><!--content-->
 
Top