forked from LaunchCode-Education-Archived/flicklist-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
28 lines (18 loc) · 703 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import webapp2
class Index(webapp2.RequestHandler):
def getRandomMovie(self):
# TODO: make a list with at least 5 movie titles
# TODO: randomly choose one of the movies, and return it
return "The Big Lebowski"
def get(self):
# choose a movie by invoking our new function
movie = self.getRandomMovie()
# build the response string
content = "<h1>Movie of the Day</h1>"
content += "<p>" + movie + "</p>"
# TODO: pick a different random movie, and display it under
# the heading "<h1>Tommorrow's Movie</h1>"
self.response.write(content)
app = webapp2.WSGIApplication([
('/', Index)
], debug=True)