1. Your pokedex lab, must have a way to choose 2 pokemon to compare. This should be a form at the top of your table, that lets you enter 2 numbers(easier), or pokemon names (harder). When you submit it, it would show you those two pokemon compared at the top.

2. Your prototypes must be updated to include the user tests you are doing this weekend. If you already did a good job on the prototype, then you don't have a lot of work to do. This prototype is 20% of your project grade.

-Project description

-Data description / sources

-Images/Description of user interaction/forms AND what data they will display

-Project phases (breakdown of tasks)

-- Include COMPLETED, and pending phases.

-The Usability test*. (Each person does 1 test)

-THE CHANGES you are making to your design after the usability test.

3. Usability test (

-Design a task for a user to complete that you think is reasonable.

(e.g.

Find the 5 most expensive neighborhoods, in NYC. (on a real estate site)

Compare the performance of the Mets and the Yankees. (on a sports site)

Show the graph of age to shoe size. (on a site that has those data points)

)

-Show a paper printout of how your site will look / work, and see how they would interact with it.

Stuyvesant is forming a partnership with Google to create a project mentorship program that will being next fall. The program will focus on pairing groups of students (1-4) with Google employees who will help them create a substantial software project.

There will be an info session for this program TODAY (5/31) at 4pm in room 307. The program will be open to rising Juniors and Seniors.

1. Make a folder in the same directory as your py file to hold your images.

mkdir img

Then change the permissions to 777. This will allow

chmod 777 img

Now you have a folder to store your images, and the following script would work:

#!/usr/bin/pythonprint"Content-type: text/html\n"

#help you see errorsimport cgitb
cgitb.enable()

#these 3 lines are important

#matplotlib allows you to use the graphing tools on a web server

#the Agg line is required to work without a graphical desktop (running on a remote computer)

1. Create an HTML form on your website. This can be an HTML file or even a py

2. Create a form handling python program (use the filename that matches the action of the form):

1. HTML FORM:

<!DOCTYPE html>

<html>

<head><title>Forms!</title></head>

<body>

<h2>This is a form</h2>

<form method="GET" action="formhandler.py">

Name:<input type="text" name="yourName" size="20" value="Bob"><br>

Repeat:<input type="text" name="count" size="20" value="0">

Use 'Yo':<input type="checkbox" name="greeting" value="yo"><br>

Pick a poke-meal:

<select name="pokechoice" size="1">

<option selected>Pika-Stew</option>

<option>Chared-Charmander</option>

<option>Bulbasalad</option>

</select>

<br>

<input type="submit" name="button" value="I'm done.">

<input type="submit" name="button" value="I'm confusedx.">

</form>

</body></html>

2. PYTHON FORM HANDLER

#!/usr/bin/pythonprint"Content-type: text/html\n"#help you see errorsimport cgitb
cgitb.enable()
# We need these library modules to retrieve the user's answersimport cgi
def cgiFieldStorageToDict( fieldStorage ):
"""Get a plain dictionary, rather than the '.value' system used by the cgi module."""
ans = {}
for key in fieldStorage.keys():
ans[ key ] = fieldStorage[ key ].value
return ans
def main():
# ask the library function to retrieve all answers and put them# into a dictionary
form = cgiFieldStorageToDict(cgi.FieldStorage())
#ONLY FOR DEBUGGING#print the form data!print form
print"<br>"#lets say you want 2 pieces of information, the name, and the count (number of times to print the name)#pick some values that you want as default #(we want to check for -1 later because we REQUIRE this value to be filled in.)
count = -1#try to replace it using the form (if it exists!)if"count"in form:
#the data must be integer formatted!
count = int(form['count'])
#pick default value (this won't cause an error if they forget to fill it out)
name = "Joe"#try to replace itif"yourName"in form:
name = form["yourName"]
#after getting all the info you need, you can now#print the body of your html using the variables that#you initialized with the form elements.if count == -1: #we didn't get the required field#ERROR BODY HEREprint"<h2>error! Did not receive all required form data!</h2>"else:
#GOOD BODY HEREprint"<h1> Main Site!</h1>"for i in range(count):
print"Hi " + name + "!<br>"
head = '''<!DOCTYPE html><html> <head> <title>Demo!</title> </head> <body>'''print head
main()
print''' </body> </html>'''