### #################################################################### ### Copyright by Erica Andrews aka CyLiKoN JeZuZ aka Li'L CJ, ### December 1999. No one is permitted to implement this script ### or any portion of it on their site without the express written ' consent ### of the author (cylikon@hotmail.com). All rights reserved. ### This script was hand-coded in Python by Erica on Dec. 28, 1999 ### Creates a bar graph based on information chosen by the user ### Allows the user to chose their favorite color scheme for the graph ### Demonstrates how Python can be used as an office or educational application. ### Professional-looking graphs with the click of a button, ### putting CGI/form-manipulation to good use ### #################################################################### import cgi form = cgi.FieldStorage() if form.has_key("Name1") : Name1 = form["Name1"].value else : Name1 = "Name1" if form.has_key("Name2") : Name2 = form["Name2"].value else : Name2 = "Name2" if form.has_key("Name3") : Name3 = form["Name3"].value else : Name3 = "Name3" if form.has_key("Name4") : Name4 = form["Name4"].value else : Name4 = "Name4" if form.has_key("Bar1") : Bar1 = form["Bar1"].value else : Bar1 = "Bar1" if form.has_key("Bar2") : Bar2 = form["Bar2"].value else : Bar2 = "Bar2" if form.has_key("Bar3") : Bar3 = form["Bar3"].value else : Bar3 = "Bar3" if form.has_key("Bar4") : Bar4 = form["Bar4"].value else : Bar4 = "Bar4" if form.has_key("number") : number = form["number"].value else : number = "number" if form.has_key("GraphTitle") : GraphTitle = form["GraphTitle"].value else : GraphTitle = "GraphTitle" #print "HTTP/1.0 200 OK\n"; print "Content-type: text/html\n\n"; print "Python Graph By Erica
" print "Python Graph by Erica" print "


" print "" print "
"; print "(Enter"; print "a name for each bar)
(Enter any number between 0 and 1,000 for each"; print "bar)
"; print "
 "; print "
"; print "
 "; print "
"; print "
"; print "
Choose a Color Scheme:
"; print "
"; print "
"; print "
"; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print "
"; print GraphTitle print "
"; print "" + Name1 + "
"; print "(" + Bar1 +")
"; print " " + Name2 +"
(" + Bar2 +")
" + Name3 +"
(" + Bar3 +")
" + Name4 +"
"; print "(" + Bar4 +")

This graph was"; print "originally scripted in

";