def get(self): p = Page() lib = FavoriteMovies() #USER ENTRY #Movie Title #Year Made #Directory md1 = MovieData() md1.title = "The Princess Bride" md1.director = "Rob Reiner" md1.year = 1989 lib.add_movie(md1) md2 = MovieData() md2.title = "Dune" md2.director = "David Lynch" md2.year = 1986 lib.add_movie(md2) md3 = MovieData() md3.title = "Star Wars" md3.director = "George Lucas" md3.year = 1977 lib.add_movie(md3) p.body = lib.compile_list() self.response.write(p.print_out(p.body, lib.calc_time_span()))
def get(self): p = Page() lib = FavoriteMovies() #instance for the FavoriteMovies #movie title (this is part of our assignment, making it user input) #year movie was made(this is part of our assignment)(this is our assignment) #director of the film (this is part of our assignment) #for this demo we will be hard-coding the above three line values do not normally do this #page for class (if/else for 2 different page views for assignment) md1 = MovieData() md1.title = "The Princess Bride" md1.year = 1989 #actually calling a function md1.director = "Rob Reiner" md2 = MovieData() md2.title = "Dune" md2.year = 1986 #actually calling a function md2.director = "David Lynch" md3 = MovieData() md3.title = "Star Wars" md3.year = 1977 #actually calling a function md3.director = "George Lucas" #lib.calc_time_span() #adds this to run but we need to add it to the printing out list below p.body = lib.compile_list() + lib.calc_time_span() #adds the compile list to the body tag of the html in the page.py self.response.write(p.print_out()) #sends the info out to browser as a big string
def get(self): # page for class p = Page() lib = FavoriteMovies() #use form to get this info #movie title #movie year #director md1 = MovieData() md1.title = "Star Wars" md1.year = 1989 md1.director = "George Lucas" lib.add_movie(md1) md2 = MovieData() md2.title = "Forrest Gump" md2.year = 1999 md2.director = "Pedro Lopez" lib.add_movie(md2) lib.calc_time_span() p.body = lib.compile_list() + lib.calc_time_span() self.response.write(p.print_out())
def get(self): #page for class p = Page() lib = FavoriteMovies() #lib object #movie title #year movie was made #director of film md1 = MovieData() md1.title = "The Princess Bride" md1.year = 1989 #calling a function md1.director = "Rob Reiner" lib.add_movie(md1) md2 = MovieData() md2.title = "Dune" md2.year = 1986 #calling a function md2.director = "David Lynch" lib.add_movie(md2) md2 = MovieData() md2.title = "Star Wars" md2.year = 1977 #calling a function md2.director = "George Lucas" lib.add_movie(md2) p.body = lib.compile_list() + lib.calc_time_span() #lib.movie_list = [md1, md2] = if it was public self.response.write(p.print_out())
def get(self): #page for class p = Page() lib = FavoriteMovies() #movie title #year movie was made #director of the film md1 = MovieData() md1.title = "The Princess Bride" md1.year = 1989 #actually calling a function md1.director = "Rob Reiner" lib.add_movie(md1) md2 = MovieData() md2.title = "Dune" md2.year = 1986 #actually calling a function md2.director = "David Lynch" lib.add_movie(md2) md2 = MovieData() md2.title = "Star wars" md2.year = 1977 #actually calling a function md2.director = "George Lucas" lib.add_movie(md2) p.body = lib.compile_list() + lib.calc_time_span() self.response.write(p.print_out()) def main(name, GPA): print "The GPA for", name,"is",GPA return 0
def get(self): p = Page() #I want to make an instance of page p.li = [['home'],['boy'],['girl'],['nature'],['animals']] p.css = "css/styles.css" #d = Data() #d.home = self.request.GET['home'] #d.boy = self.request.GET['boy'] #d.girl = self.request.GET['girl'] #d.nature = self.request.GET['nature'] #d.animals = self.request.GET['animals'] self.response.write(p.print_out())
def get(self): if self.request.GET: # if you can get these items then print this material first = self.request.GET['first'] # this is storing form info in a variable and then using that info for printing last = self.request.GET['last'] # this is storing form info in a variable and then using that info for printing email = self.request.GET['email'] # this is storing form info in a variable and then using that info for printing radio = self.request.GET['gender'] # this is storing form info in a variable and then using that info for printing check = self.request.GET['experience'] # this is storing form info in a variable and then using that info for printing select = self.request.GET['education'] # this is storing form info in a variable and then using that info for printing number = self.request.GET['quantity'] # this is storing form info in a variable and then using that info for printing self.response.write(first + ' ' + last + ' ' + email + ' ' + radio + ' ' + check + ' ' + select + ' ' + number) # this compiles all of the variable info from the form and prints it to the browser. else: p = Page() # this makes an instance of the page class from the pages.py file self.response.write(p.print_out()) # this prints it out to the window
def get(self): p = Page() lib = FavoriteMovies() md1 = MovieData() md1.title = "The Princess Bride" md1.year = 1989 # actually calling a function md1.director = "Rob Reiner" lib.add_movie(md1) md2 = MovieData() md2.title = "Dune" md2.year = 1986 md2.director = "David Lynch" lib.add_movie(md2) md3 = MovieData() md3.title = "Star Wars" md3.year = 1977 md3.director = "George Lucus" lib.add_movie(md3) p.body = lib.compile_list() + lib.calc_time_span() self.response.write(p.print_out())
def get(self): p = Page() self.response.write(p.print_out())
def get(self): p = Page() p.body = "Miss Piggy like Kermit De Frog!" self.response.write(p.print_out())
def get(self): p = Page() p.body = "Update" self.response.write(p.print_out())
def get(self): #self.response.write('Hello world!') p = Page() p.body = "This is Stacys Python Example" self.response.write(p.print_out())
def get(self): p = Page() p.body = "Miss Piggy like Kermit De Frog" self.response.write(p.print_out())
def get(self): p = Page() p.body = "Hello World" self.response.write(p.print_out())
def get(self): #function defines attributes of five objects: s, n, f, j, m #get function print_out to print html #get function if statement that defines condition for printing class Delivered attributes s = Delivered()#defines class delivered attributes for September s.sale1 = 40#how much it cost each sales s.sale2 = 69 s.sale3 = 36 s.sale4 = 89 s.sale5 = 24 s.calc_total()#function to calculate the total of September sales. #"November" class delivered variables n = Delivered()#defines class delivered attributes for November n.sale1 = 50#how much it cost each sales n.sale2 = 55 n.sale3 = 68 n.sale4 = 93 n.sale5 = 32 n.calc_total()#function to calculate the total of November sales. #February delivered f = Delivered()#defines class delivered attributes for February f.sale1 = 24#how much it cost each sales f.sale2 = 12 f.sale3 = 18 f.sale4 = 84 f.sale5 = 34 f.calc_total()#function to calculate the total of February sales. j = Delivered()#defines class delivered attributes for June j.sale1 = 50#how much it cost each sales j.sale2 = 50 j.sale3 = 50 j.sale4 = 50 j.sale5 = 50 j.calc_total()#function to calculate the total of June sales. #May delivered m = Delivered()#defines class delivered attributes for May m.sale1 = 50#how much it cost each sales m.sale2 = 50 m.sale3 = 50 m.sale4 = 50 m.sale5 = 50 m.calc_total()#function to calculate the total of May sales. #call class Page to print in this page p = Page() self.response.write(p.print_out()) #if the links are requested, it's print_out_data function called to print the data from the self.month if self.request.GET: #if we have September after name in url if self.request.GET['name'] == 'september': p.month_data = s #part of the html from class Page that holds the class Delivered attributes for each month title ='s.title' self.response.write(p.print_out_data())# call function print_out_data from class Page to print Delivered attributes. #if we have November after name in url elif self.request.GET ['name'] == 'november': p.month_data = n self.response.write('November' + p.print_out_data()) #if we have February after name in url elif self.request.GET ['name'] == 'february': p.month_data = f self.response.write(p.print_out_data()) #if we have June after name in url elif self.request.GET ['name'] == 'june': p.month_data = j self.response.write(p.print_out_data()) #if we have May after name in url elif self.request.GET ['name'] == 'may': p.month_data = m self.response.write(p.print_out_data()) #if we don't find any of the names above after name in url, just print same page else: self.response.write(p.head + p.body + p.close) #the print is empty to avoid the same page print twice. else: self.response.write('')
def get(self): #Membership Data Information #Charles Registration c = Registration() c.name = "Charles" c.address = "124 Main Street, Chambersburg, PA 17201" c.phone = "717-555-9545" c.level = "Professional" c.horses = 5 c.fee = 125.95 c.calc_price() #self.response.write ("<strong>Name:</strong> " + c.name + "<br /><strong>Address:</strong> " + c.address + "<br /><strong>Phone:</strong> " + c.phone + "<br /><strong>Membership Level:</strong> " + c.level + "<br /><strong>Number of Horses Registered:</strong> " + str(c.horses) + "<br /><strong>Total Registration Fee:</strong> $" + str(c.final_price)) #Megan Registration m = Registration() m.name = "Megan" m.address = "567 Second Street, Chambersburg, PA 17201" m.phone = "717-555-9545" m.level = "Youth" m.horses = 15 m.fee = 25.95 m.calc_price() #self.response.write ("<br><br><strong>Name:</strong> " + m.name + "<br /><strong>Address:</strong> " + m.address + "<br /><strong>Phone:</strong> " + m.phone + "<br /><strong>Membership Level:</strong> " + m.level + "<br /><strong>Number of Horses Registered:</strong> " + str(m.horses) + "<br /><strong>Total Registration Fee:</strong> $" + str(m.final_price)) #Duke Registration d = Registration() d.name = "Duke" d.address = "2905 Roland Avenue, Chambersburg, PA 17201" d.phone = "555-234-6789" d.level = "Amatuer" d.horses = 1 d.fee = 75.95 d.calc_price() #self.response.write ("<br><br><strong>Name:</strong> " + d.name + "<br /><strong>Address:</strong> " + d.address + "<br /><strong>Phone:</strong> " + d.phone + "<br /><strong>Membership Level:</strong> " + d.level + "<br /><strong>Number of Horses Registered:</strong> " + str(d.horses) + "<br /><strong>Total Registration Fee:</strong> $" + str(d.final_price)) #Jenn Registration j = Registration() j.name = "Jennifer" j.address = "9012 Norland Avenue, Chambersburg, PA 17201" j.phone = "555-573-9753" j.level = "Youth" j.horses = 5 j.fee = 25.95 j.calc_price() #self.response.write ("<br><br><strong>Name:</strong> " + j.name + "<br /><strong>Address:</strong> " + j.address + "<br /><strong>Phone:</strong> " + j.phone + "<br /><strong>Membership Level:</strong> " + j.level + "<br /><strong>Number of Horses Registered:</strong> " + str(j.horses) + "<br /><strong>Total Registration Fee:</strong> $" + str(j.final_price)) #Tara's Registration t = Registration() t.name = "Tara" t.address = "1242 Livermoore Road, Chambersburg, PA 17201" t.phone = "555-234-9874" t.level = "Professional" t.horses = 15 t.fee = 125.95 t.calc_price() #self.response.write ("<br><br><strong>Name:</strong> " + t.name + "<br /><strong>Address:</strong> " + t.address + "<br /><strong>Phone:</strong> " + t.phone + "<br /><strong>Membership Level:</strong> " + t.level + "<br /><strong>Number of Horses Registered:</strong> " + str(t.horses) + "<br /><strong>Total Registration Fee:</strong> $" + str(t.final_price)) p = Page() #p.body = "<strong>Name:</strong> " + c.name + "<br /><strong>Address:</strong> " + c.address + "<br /><strong>Phone:</strong> " + c.phone + "<br /><strong>Membership Level:</strong> " + c.level + "<br /><strong>Number of Horses Registered:</strong> " + str(c.horses) + "<br /><strong>Total Registration Fee:</strong> $" + str(c.final_price) + "<br/><hr><strong>Name:</strong> " + m.name + "<br /><strong>Address:</strong> " + m.address + "<br /><strong>Phone:</strong> " + m.phone + "<br /><strong>Membership Level:</strong> " + m.level + "<br /><strong>Number of Horses Registered:</strong> " + str(m.horses) + "<br /><strong>Total Registration Fee:</strong> $" + str(m.final_price) + "<br/><hr><strong>Name:</strong> " + d.name + "<br /><strong>Address:</strong> " + d.address + "<br /><strong>Phone:</strong> " + d.phone + "<br /><strong>Membership Level:</strong> " + m.level + "<br /><strong>Number of Horses Registered:</strong> " + str(d.horses) + "<br /><strong>Total Registration Fee:</strong> $" + str(d.final_price) + "<br/><hr><strong>Name:</strong> " + j.name + "<br /><strong>Address:</strong> " + j.address + "<br /><strong>Phone:</strong> " + j.phone + "<br /><strong>Membership Level:</strong> " + j.level + "<br /><strong>Number of Horses Registered:</strong> " + str(j.horses) + "<br /><strong>Total Registration Fee:</strong> $" + str(j.final_price) + "<br/><hr><strong>Name:</strong> " + t.name + "<br /><strong>Address:</strong> " + t.address + "<br /><strong>Phone:</strong> " + t.phone + "<br /><strong>Membership Level:</strong> " + t.level + "<br /><strong>Number of Horses Registered:</strong> " + str(t.horses) + "<br /><strong>Total Registration Fee:</strong> $" + str(t.final_price) p.body = "<h1>Registered Members</h1><a href='?name="+ c.name +"'>" + c.name + "</a><br>" + "<a href='?name="+ m.name +"'>" + m.name + "</a><br>" + "<a href='?name="+ d.name +"'>" + d.name + "</a><br>" + "<a href='?name="+ j.name +"'>" + j.name + "</a><br>" + "<a href='?name="+ t.name +"'>" + t.name + "</a><br>" # When link is click and there is variables this following is viewed if self.request.GET: name = self.request.GET['name'] # if variable = Charles if name == "Charles": address = c.address phone = c.phone level = c.level horses = c.horses fee = c.fee _final_price = m.calc_price() p.view = "<hr><h1>View Member Information:</h1><strong>Name:</strong> " + name + "<br/><strong>Address:</strong> " + address + "<br><strong>Phone:</strong> " + phone + "</br><strong>Address:</strong> " + level + "<br/><strong>Horses:</strong> " + str(horses) + "<br/><strong>Registration Fee:</strong> $" + str(fee) + "<br/><strong>Final Registration Price:</strong> $" + str(_final_price) # if variable = Megan if name == "Megan": address = m.address phone = m.phone level = m.level horses = m.horses fee = m.fee _final_price = m.calc_price() p.view = "<hr><h1>View Member Information:</h1><strong>Name:</strong> " + name + "<br/><strong>Address:</strong> " + address + "<br><strong>Phone:</strong> " + phone + "</br><strong>Address:</strong> " + level + "<br/><strong>Horses:</strong> " + str(horses) + "<br/><strong>Registration Fee:</strong> $" + str(fee) + "<br/><strong>Final Registration Price:</strong> $" + str(_final_price) # if variable = Duke if name == "Duke": address = d.address phone = d.phone level = d.level horses = d.horses fee = d.fee _final_price = d.calc_price() p.view = "<hr><h1>View Member Information:</h1><strong>Name:</strong> " + name + "<br/><strong>Address:</strong> " + address + "<br><strong>Phone:</strong> " + phone + "</br><strong>Address:</strong> " + level + "<br/><strong>Horses:</strong> " + str(horses) + "<br/><strong>Registration:</strong> $" + str(fee) + "<br/><strong>Final Registration Price:</strong> $" + str(_final_price) # if variable = Jennifer if name == "Jennifer": address = j.address phone = j.phone level = j.level horses = j.horses fee = j.fee _final_price = j.calc_price() p.view = "<hr><h1>View Member Information:</h1><strong>Name:</strong> " + name + "<br/><strong>Address:</strong> " + address + "<br><strong>Phone:</strong> " + phone + "</br><strong>Address:</strong> " + level + "<br/><strong>Horses:</strong> " + str(horses) + "<br/><strong>Registration:</strong> $" + str(fee) + "<br/><strong>Final Registration Price:</strong> $" + str(_final_price) # if variable = Tara if name == "Tara": address = t.address phone = t.phone level = t.level horses = t.horses fee = t.fee _final_price = t.calc_price() p.view = "<hr><h1>View Member Information:</h1><strong>Name:</strong> " + name + "<br/><strong>Address:</strong> " + address + "<br><strong>Phone:</strong> " + phone + "</br><strong>Address:</strong> " + level + "<br/><strong>Horses:</strong> " + str(horses) + "<br/><strong>Registration:</strong> $" + str(fee) + "<br/><strong>Final Registration Price:</strong> $" + str(_final_price) else: # if no variables then nothing is viewed p.view = '' self.response.write(p.print_out())
def get(self): p = Page() p.body = 'Miss Piggy likes Kermit de Frog' self.response.write(p.print_out())
def get(self): p = Page() #instance of page p.body = "Miss Piggy Likes Kermit De Frog!" self.response.write(p.print_out()) #prints out to browser
def get(self): p = Page() p.body ="Miss Piggy likes Chocolate!" #modify's self.body self.response.write(p.print_out())
def get(self): p = Page() p.body = "Miss Piggy is aweful!" self.response.write(p.print_out())
def get(self): p = Page() p.body = "Miss Piggy likes Kermit de Frog" #this will replace the body text below in self.body #print p.print_out()#this will print out in the google engine console self.response.write(p.print_out())# this will print out in browser