当前位置: 首页>>代码示例>>Python>>正文


Python Page.title方法代码示例

本文整理汇总了Python中pages.Page.title方法的典型用法代码示例。如果您正苦于以下问题:Python Page.title方法的具体用法?Python Page.title怎么用?Python Page.title使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pages.Page的用法示例。


在下文中一共展示了Page.title方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get

# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import title [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)
开发者ID:Akluba,项目名称:pythonProjects,代码行数:9,代码来源:main.py

示例2: get

# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import title [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)
开发者ID:allisondsharpe,项目名称:dpwp,代码行数:9,代码来源:main.py

示例3: get

# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import title [as 别名]
 def get(self):
     p = Page()
     p.title = "My Page"
     p.css = "/css/style.css"
     p.body = "Changer"
     p.update()
     self.response.write(p.whole_page)
开发者ID:mrthomasjackson,项目名称:DPW,代码行数:9,代码来源:main.py

示例4: get

# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import title [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)
开发者ID:NenaH77,项目名称:DPW,代码行数:9,代码来源:main.py

示例5: get

# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import title [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)
开发者ID:sgehrke,项目名称:Gehrke_Shaun_DPW,代码行数:9,代码来源:main.py

示例6: get

# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import title [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)
开发者ID:FreeDaGeek,项目名称:DesignPattern,代码行数:9,代码来源:main.py

示例7: get

# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import title [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)
开发者ID:TaylorCawiezell,项目名称:DPW,代码行数:9,代码来源:main.py

示例8: get

# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import title [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)
开发者ID:istacy,项目名称:DesignPatternsWebProgramming,代码行数:11,代码来源:main.py

示例9: get

# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import title [as 别名]
 def get(self):
     p = Page()
     p.title = "My page!"
     p.css = "css/style.css"
     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 (removed for getter/setter example)
    # p.update() #replacing the above #self.response......
     #let's remove p.update() from here and add to main.py to have it auto update whenever data changes; it won't be p.update it will be self.update over there
     self.response.write(p.whole_page)
开发者ID:jnashsiegle,项目名称:JSON-Python,代码行数:12,代码来源:main.py

示例10: get

# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import title [as 别名]
    def get(self):
        #create a shortcut to the Page() class
        p = Page()

        #if the GET method is invoked, grab the form values and set them to the proper keys
        if self.request.GET:

            #create a shortcut for self.request
            sr = self.request

            #set the page title.
            p.title = "Eric Rogers | Thank You!"

            #set the Page().name attribute to the input value submitted.
            p.name = sr.GET['name']

            #set the Page().telephone attribute to the input value submitted.
            p.telephone = sr.GET['telephone']

            #set the Page().email attribute to the input value submitted.
            p.email = sr.GET['email']

            #set the Page().interest attribute to the input value submitted.
            p.interest = sr.GET['interest']

            #set the Page().return_customer attribute to reflect the user's choice when checked.
            p.return_customer = 'Yes, please give me a 10% discount.'

            #try to grab the Page().return_customer checkbox value
            try:
                sr.GET['return_customer']

            #if there is no value, the server throws a KeyError meaning the box is not checked.
            except KeyError:

                #set the Page().return_customer attribute to reflect the user's choice when not checked.
                p.return_customer = 'No, I am a new customer.'

            #output Page().view2 to the page.
            self.response.write(p.view2())

        #otherwise, output Page().view1 to the page.
        else:
            self.response.write(p.view1())
开发者ID:ericgrogers,项目名称:DPW,代码行数:46,代码来源:main.py

示例11: get

# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import title [as 别名]
    def get(self):
        # Establishes variables to allow interaction with designated class.
        a1 = Snake()
        a2 = Bird()
        a3 = Person()
        # Stores all animals defined in object
        self.animals = [a1, a2, a3]
        # Defines p as referring to Page class
        p = Page()
        # Runs the update command on page to concatinate the first pages info
        p.update()

        # Listens for an occurance of animal in the browsers request. Essentially listening for a button click
        if "animal" in self.request.GET:
            # Sets current animals value based on which request was made
            p.current_animal = self.animals[int(self.request.GET["animal"])]
            # Changes the Title of the page to match the selected animal
            p.title = self.animals[int(self.request.GET["animal"])].name
            # plays the sound specific for that animal
            p.loud_noises = self.animals[int(self.request.GET["animal"])].sound
            # Writes contents of whole page to the browser. The update function assembles this
            self.response.write(p.whole_page)
        else:
            self.response.write(p.whole_page)
开发者ID:HeadShotBoom,项目名称:DPWP,代码行数:26,代码来源:main.py

示例12: get

# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import title [as 别名]
    def get(self):
        # Establishes p as referring to the Page class
        p = Page()
        # p.title uses the title setter in the Page class to set the value of title, the line below is similar
        p.title = "Encapsulated Calculator"
        p.css = "css/styles.css"

        # c1 uses the Cameras class to assemble an object with the following attributes and sets their values
        # c2=c5 is identical in function
        c1 = Cameras()
        c1.name = "Canon 5d3"
        c1.body_cost = 3000
        c1.lens_cost = 5000
        c1.accessories_cost = 1000
        c1.quality = "High"
        c1.calc_value()

        c2 = Cameras()
        c2.name = "Nikon D800"
        c2.body_cost = 2500
        c2.lens_cost = 1500
        c2.accessories_cost = 200
        c2.quality = "Low"
        c2.calc_value()

        c3 = Cameras()
        c3.name = "Leica M9"
        c3.body_cost = 100
        c3.lens_cost = 500
        c3.accessories_cost = 100
        c3.quality = "Medium"
        c3.calc_value()

        c4 = Cameras()
        c4.name = "Pentax MX1"
        c4.body_cost = 2000
        c4.lens_cost = 200
        c4.accessories_cost = 50
        c4.quality = "High"
        c4.calc_value()

        c5 = Cameras()
        c5.name = "GoPro Hero5 Platinum"
        c5.body_cost = 10000
        c5.lens_cost = 0
        c5.accessories_cost = 10
        c5.quality = "Low"
        c5.calc_value()

        # This establishes a variable that consolisates all c1-c5 objects
        all_these_cameras = [c1, c2, c3, c4, c5]


        # Checks if there is an instance of "cameras" in the request pushed from the browser
        if "cameras" in self.request.GET:
            # Uses a value in the request to determine which cX object I am requesting
            # and sets just that object to the current_camera variable in Page class.
            p.current_camera = all_these_cameras[int(self.request.GET["cameras"])]
            # Writes the entire contents of whole_page variable in Page class to the browser
            self.response.write(p.whole_page)
        else:
            # Writes the info to the browser even if a request hasnt been made.
            self.response.write(p.whole_page)
开发者ID:HeadShotBoom,项目名称:DPWP,代码行数:65,代码来源:main.py

示例13: get

# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import title [as 别名]
 def get(self):
     p = Page()
     p.title = "My Page"
     p.body = "Miss Piggy likes Kermit De Frog!"
     self.response.write(p.whole_page)
开发者ID:HeadShotBoom,项目名称:DPWP,代码行数:7,代码来源:main.py

示例14: get

# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import title [as 别名]
 def get(self):
     p = Page()
     p.title = "My page!"
     p.css = "css/style.css"
     p.body = "Hello World"
     self.response.write(p.whole_page)
开发者ID:cferguson1,项目名称:DPW,代码行数:8,代码来源:main.py

示例15: get

# 需要导入模块: from pages import Page [as 别名]
# 或者: from pages.Page import title [as 别名]
    def get(self):
        h = hello()
        p = Page()
        p.title = "My New Page"
        p.css = "css/styles.css"
        p.update() #referencing my update class from pages
        h.update_this()

        # I will create an application that calculates the remaining storage for different users

        #now I will hard code the values for each data object



        m = Storage()
        m.pictures = 5
        m.videos = 10
        m.documents = 1
        m.music = 3
        m.apps = 4

        #write the values to the page

        if self.request.GET:
            total = self.request.GET['totalStorage']
            self.response.write(h.user_page_update + "Total storage used is  " + total + " GB <br/> There is  " + str(m.final_storage) + " GB of storage remaining")

        else:
            self.response.write(p.user_page)  #writing the user_page which has has all the html for my application

    #now I am going create the remaining users

        #now I will hard code the values for each data object
        t = Storage()
        t.pictures = 10
        t.videos = 10
        t.documents = 1
        t.music = 20
        t.apps = 7
        #write the values to the page
        # self.response.write(" <br/> Todd has  " + str(t.final_storage) + " GB of storage remaining") #writing the user_page which has has all the html for my application





#now I will hard code the values for each data object
        n = Storage()
        n.pictures = 1
        n.videos = 4
        n.documents = 1
        n.music = 9
        n.apps = 7
        #write the values to the page
        # self.response.write(" <br/> Nancy has  " + str(n.final_storage) + " GB of storage remaining") #writing the user_page which has has all the html for my application


#now I will hard code the values for each data object
        h = Storage()
        h.pictures = 18
        h.videos = 10
        h.documents = 1
        h.music = 6
        h.apps = 7
        #write the values to the page
        # self.response.write(" <br/> Henry has  " + str(h.final_storage) + " GB of storage remaining") #writing the user_page which has has all the html for my application


#now I will hard code the values for each data object
        j = Storage()
        j.pictures = 6
        j.videos = 4
        j.documents = 1
        j.music = 7
        j.apps = 2
开发者ID:tswinnie,项目名称:designWeb,代码行数:77,代码来源:main.py


注:本文中的pages.Page.title方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。