Beispiel #1
0
#!/usr/local/bin/python
# The Script that will do all grading
# Daryl Herzmann 7/27/98

from cgi import *
import style, pgext

mydbase = pgext.connect("archwx")


def table():
    results = mydbase.query("Select * from jun1898")
    results = results.getresult()
    results.sort()

    for i in range(len(results)):
        state = results[i][0]
        type = results[i][1]
        time = results[i][2]
        print "<tr><td>" + state + "</td>"
        if type == "T":
            print "<td><B>Tornado</B></td>"
        elif type == "H":
            print "<td>Hail</td>"
        elif type == "R":
            print '<td>3"+ Rainfall</td>'
        if time == "1":
            print "<td>12-3 PM (CDT)</td>"
        elif time == "2":
            print "<td>3-6 PM (CDT)</td>"
        elif time == "3":
Beispiel #2
0
#!/usr/local/bin/python
# The Script that will do all grading 
# Daryl Herzmann 7/30/98

from cgi import *
import style, pgext, os, posix

mydbase = pgext.connect("archanswers")

form = FormContent() 
state = form["state"][0]
time = form["time"][0]


def table(today): 
        results = mydbase.query("Select * from "+today+"") 
        results = results.getresult() 
        results.sort()
	for i in range(len(results)): 
                state2 = results[i][0]
                type = results[i][1]
                time = results[i][2]
                if state == state2:
			print '<tr><td><blink>'+state2+'</blink></td>'
		else:
			print '<tr><td>'+state2+'</td>'
		if type == "T": 
                        print '<td><B>Tornado</B></td>'
                elif type == "H": 
                        print '<td>Hail</td>'
                elif type == "R": 
Beispiel #3
0
#!/usr/local/bin/python
# The new and improved version that passes the data on...
# Daryl Herzmann 9/14/98

from cgi import *
import style, pgext

mydbase = pgext.connect("archdays")

def Main():
	real = "18"
	form = FormContent()
	today = form["day"][0]
	state = form["state"][0]	
	time = form["time"][0]	
	month_name = form["month_name"][0]
	month_num = form["month_num"][0]
	if state == "( Select a State )": style.SendError("Please enter a state")
	if time == "( Select a time )": style.SendError("Please choose a time")	
        if form.has_key("T"): 
		tornado = form["T"][0]
        else: tornado = "no"
	if form.has_key("H"): 
		hail = form["H"][0]
	else: hail = "no"
	if form.has_key("R"): 
		rain = form["R"][0]
	else: rain = "no"
	if tornado == "no":
		if hail == "no":
			if rain == "no":