I'm trying to run a Python script on Abyss Web Server Console on my local machine. Here are the scripting parameters that I've configured...
And the Python script that I'm trying to run..
import cgi
form = cgi.FieldStorage()
print('Content-Type:text/html; charset=utf-8')
print('\r\n\r\n')
print('''<!DOCTYPE html>
<html><title>Web Server Response</title>
<style>tr,th,td{border:2px solid Gray}</style>''')
print('<table style"width:500px"><tr><th>Key<th>Value')
for i in form.keys():
key = str(i)
val = str(form.getvalue(key))
print('<tr><td>' + key + '<td>' + val)
print('''</tr></table>)
<img src="pwrabyss.gif"> </html>''')
I've saved it as "C:\Abyss Web Server\htdocs\echo.py"
I was expecting a page with an empty table containing two headers labeled "Key" and "Value"
When I enter "http://localhost/echo.py" into my browser though, I get a result of "Error 500: Internal server error."
I've tried disabling my firewall and antivirus. I've tried simplifying the python code to this...
print ("Content-Type: text/html")
print ()
print("<h1>Hello World!</h1>")
No matter what I do I still get the same result.
When I look in the cgi.log file I see entries that say, "Bad executable" at the end. When I run the script from the command prompt though it works as expected.
What am I doing wrong?