本文整理汇总了Python中pages.Page.body方法的典型用法代码示例。如果您正苦于以下问题:Python Page.body方法的具体用法?Python Page.body怎么用?Python Page.body使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pages.Page
的用法示例。
在下文中一共展示了Page.body方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import body [as 别名]
def get(self):
p = Page()
p.title = "My Page"
p.css = "css/style.css"
p.body = "this is the body"
self.response.write(p.whole_page)
示例2: get
# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import body [as 别名]
def get(self):
# create an instance of the page class - creates a page using this class - it will also call the constructor method
p = Page()
p.title = "MyPage!"
p.body = "Miss piggy loves Kermit da Frog"
self.response.write(p.whole_page)
示例3: get
# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import body [as 别名]
def get(self):
p = Page()
p.title = 'My Page!'
p.css = 'css/style.css'
p.body = 'Miss Piggy likes Kermit de Frog'
p.update()
self.response.write(p.whole_page)
示例4: get
# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import body [as 别名]
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
示例5: get
# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import body [as 别名]
def get(self):
p = Page()
p.title ="My page"
p.css ="css/styles.css"
p.body = "Miss Piggy like Kermit De Frog"
self.response.write(p.whole_page)
示例6: get
# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import body [as 别名]
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
示例7: get
# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import body [as 别名]
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())
示例8: get
# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import body [as 别名]
def get(self):
p = Page()
p.title = 'My Page!'
p.css = 'css/main.css'
p.body = "Miss Piggy is aweful!"
p.update()
self.response.write(p.whole_page)
示例9: get
# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import body [as 别名]
def get(self):
p = Page()
p.title = "My page!"
p.css = "css/style.css"
p.body = "Miss Piggy likes Kermit De Frog!" #modify body element
self.response.write(p.whole_page)
示例10: get
# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import body [as 别名]
def get(self):
p = Page()
p.title = "My page!" #Setter was created so we could change
p.css = "css/style.css"
p.body = "Miss Piggy likes Kermit de Frog!"
p.update()
self.response.write(p.whole_page)
示例11: get
# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import body [as 别名]
def get(self):
#self.response.write('Hello world!')
p = Page()
p.title = "My Page"
p.css = "css/style.css"
p.body = "This is Stacy's Python Example"
#self.response.write(p.print_out())
p.update()
self.response.write(p.whole_page)
示例12: get
# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import body [as 别名]
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())
示例13: get
# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import body [as 别名]
def get(self):
p = Page()
p.title = "My Page"
p.body = "Miss Piggy likes Kermit De Frog!"
self.response.write(p.whole_page)
示例14: get
# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import body [as 别名]
def get(self):
p = Page()
p.body = "Hello World"
self.response.write(p.print_out())
示例15: get
# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import body [as 别名]
def get(self):
p = Page()
p.title = "My Page!"
p.css = "css/style.css"
p.body = "Apples!"
self.response.write(p.whole_page)