本文整理汇总了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
示例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