Hello all:

I am VERY new at any programming of any sort, so any help would be appreciated.

This is the new and improved error message I get when I am trying to run the attached script:

Script Error

 

There was an error with your script and it didn't exit properly.

 

This was its output:

 

  File "/home/jgates/public_html/Fifthone2.py", line 36

    print "#blend {

 

Any advice?

 

Jennine

 


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.9.2/55 - Release Date: 21/07/2005

import cgitb;
cgitb.enable()
import cgi
form = cgi.FieldStorage()

print "Content-type: text/html"
print
print """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";>"""

red1 = int (form["red1"].value)
green1 = int (form["green1"].value)
blue1 = int (form["blue1"].value)
red2 = int (form["red2"].value)
green2 = int (form["green2"].value)
blue2 = int (form["blue2"].value)

nsteps = int (form["steps"].value)
for i in range(nsteps):
    print i,

    fraction = (i+1.0)/nsteps
    r = (1-fraction)*red1 + fraction*red2
    g = (1-fraction)*green1 + fraction*green2
    b = (1-fraction)*blue1 + fraction*green2

    
print "<html>"
print "<head>"
print "<title>Colour Blend</title>"
print '<div class="colourblock"'
print 'style="background-color: rgb(' + str(r) + '%,' + str(g) + '%,' + str(b) 
+ '%)">'
print '</div>'
print "<style type= text/css>"
print "#blend {
    width: 10em;
    padding: 0;
    border: 1px solid black;
    margin-left: 3em
}
..colourblock {
    width: 10em;
    height: 1em;}"
print "</style>"
print "</head>"
print "<body>"
print "<h1>Colour Blend</h1>"
print "<p>Here is a mix of the two colours you specified:</p>" print "<div 
id="blend">"
print "</div>"
print "<hr class= footlink >Return to <a href= </a>the index</a>.</p>"
print "</body>"
print "</html>"
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to