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


Python Page.index_num方法代码示例

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


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

示例1: Page

# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import index_num [as 别名]
import os
from page import Page
from random import choice
import colours
from colours import colour_print
from printer import instance as printer

page_number = os.path.splitext(os.path.basename(__file__))[0]
sub_page = Page(page_number)
sub_page.title = "Annawards"
sub_page.index_num = "456-457"
content = colour_print(
    printer.text_to_ascii("Annawards", padding={"left": 6}))

awards = [
          ["Boo Cow Annawards",{"Pietro Servini":1,"Stephen Muirhead":1,"Belgin Seymenoglu":2}],
            # Tea Wrecks was formerly known as Tea Breaker
          ["Tea Wrecks Annawards",{"Anna Lambert":1,"Rafael Prieto Curiel":1,"Belgin Seymenoglu":1}],
          ["Towel Flood Annawards",{"Jigsaw":1,"Belgin Seymenoglu":2}],
          ["Worst Sorting Hat",{"Anna Lambert":20}],
          ["Boo Key",{"Anna Lambert":1,"Sam Brown":1,"Rafael Prieto Curiel":1,"Mart Wright":1}],
          ["Stolen Pen",{"Anna Lambert":1}]
         ]
pages = ["457","457","458","458","458","458"]

content += "\nWho has the most Annawards?\n\n"

for i,award in enumerate(awards):
    content += "\n"+sub_page.colours.Foreground.GREEN+award[0]+sub_page.colours.Foreground.DEFAULT+" (see page "+pages[i]+")\n"
    max_ = 0
    max_p = None
开发者ID:Giannie,项目名称:KLBFAX,代码行数:33,代码来源:456.py

示例2: Page

# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import index_num [as 别名]
import os
from os.path import join,expanduser
from page import Page
from printer import instance as printer

page_number = os.path.splitext(os.path.basename(__file__))[0]
p_page = Page(page_number)

p_page.title = "House Points"
p_page.index_num = "402-403"

content = p_page.colours.colour_print(printer.text_to_ascii("house points"))

content += "\n\n"

R = p_page.colours.Foreground.RED
G = p_page.colours.Foreground.GREEN
D = p_page.colours.Foreground.DEFAULT

content += G+"Year " + " Gryffindor Slytherin Hufflepuff"    +   " Ravenclaw Durmstrang Squib Peeves"+D+"\n"
content += G+"2015a"+D+" 692        535       "+R+"1155"+D+"       702       440        513   0\n"
content += G+"2015b"+D+" 3382       408       "+R+"4614"+D+"       3591      606        2174  38\n"

p_page.content = content
开发者ID:Giannie,项目名称:KLBFAX,代码行数:26,代码来源:402.py


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