本文整理汇总了Python中isoweek.Week.friday方法的典型用法代码示例。如果您正苦于以下问题:Python Week.friday方法的具体用法?Python Week.friday怎么用?Python Week.friday使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类isoweek.Week
的用法示例。
在下文中一共展示了Week.friday方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: make_o
# 需要导入模块: from isoweek import Week [as 别名]
# 或者: from isoweek.Week import friday [as 别名]
def make_o(current_year_num, begin_week_num):
current_week = Week(current_year_num, begin_week_num)
commit(current_week.wednesday())
commit(current_week.thursday())
current_week = Week(current_year_num, begin_week_num + 1 )
commit(current_week.tuesday())
commit(current_week.friday())
current_week = Week(current_year_num, begin_week_num + 2 )
commit(current_week.tuesday())
commit(current_week.friday())
current_week = Week(current_year_num, begin_week_num + 3 )
commit(current_week.wednesday())
commit(current_week.thursday())
示例2: test_days
# 需要导入模块: from isoweek import Week [as 别名]
# 或者: from isoweek.Week import friday [as 别名]
def test_days(self):
w = Week(2011, 20)
self.assertEqual(w.monday().isoformat(), "2011-05-16")
self.assertEqual(w.tuesday().isoformat(), "2011-05-17")
self.assertEqual(w.wednesday().isoformat(), "2011-05-18")
self.assertEqual(w.thursday().isoformat(), "2011-05-19")
self.assertEqual(w.friday().isoformat(), "2011-05-20")
self.assertEqual(w.saturday().isoformat(), "2011-05-21")
self.assertEqual(w.sunday().isoformat(), "2011-05-22")
self.assertEqual(w.day(0).isoformat(), "2011-05-16")
self.assertEqual(w.day(-1).isoformat(), "2011-05-15")
self.assertEqual(w.day(10).isoformat(), "2011-05-26")
days = w.days()
self.assertEqual(len(days), 7)
self.assertEqual(days[0].isoformat(), "2011-05-16")
self.assertEqual(days[-1].isoformat(), "2011-05-22")
from datetime import date
self.assertFalse(w.contains(date(2011,5,15)))
self.assertTrue(w.contains(date(2011,5,16)))
self.assertTrue(w.contains(date(2011,5,22)))
self.assertFalse(w.contains(date(2011,5,23)))
示例3: plan_to_xml
# 需要导入模块: from isoweek import Week [as 别名]
# 或者: from isoweek.Week import friday [as 别名]
def plan_to_xml(self):
dateiname = "E" + str(self.__JG) + "_SG" + str(self.__SG) + "_KW_" + str(self.__KW) + ".xml"
try:
os.remove(dateiname)
except:
pass
woche = Week(2015, self.__KW)
print(woche)
self.daten[1] = woche.monday().strftime("%d.%m.%Y")
self.daten[2] = woche.tuesday().strftime("%d.%m.%Y")
self.daten[3] = woche.wednesday().strftime("%d.%m.%Y")
self.daten[4] = woche.thursday().strftime("%d.%m.%Y")
self.daten[5] = woche.friday().strftime("%d.%m.%Y")
implement = xml.dom.getDOMImplementation()
doc = implement.createDocument(None, "Stundenplan", None)
info_elem = doc.createElement("INFO")
info_elem.setAttribute("KW", str(self.__KW))
info_elem.setAttribute("JG", str(self.__JG))
info_elem.setAttribute("SG", str(self.__SG))
doc.documentElement.appendChild(info_elem)
for i in range(5):
i += 1
tag_plan = self.__PLAN.get_tag(i)
tag_elem = doc.createElement("Tag")
tag_elem.setAttribute("Datum", self.daten[i])
for i in range(10):
i += 1
stunde_elem = doc.createElement("Stunde")
stunde_elem.setAttribute("stunde", str(i))
stunde_elem.setAttribute("START", self.uhrzeiten_start[i])
stunde_elem.setAttribute("END", self.uhrzeiten_ende[i])
stunde_elem.setAttribute("AEND", str(tag_plan.get_unterricht(i)[3]))
thema_elem = doc.createElement("Thema")
thema_text = doc.createTextNode(tag_plan.get_unterricht(i)[0])
thema_elem.appendChild(thema_text)
dozent_elem = doc.createElement("Dozent")
dozent_text = doc.createTextNode(tag_plan.get_unterricht(i)[1])
dozent_elem.appendChild(dozent_text)
raum_elem = doc.createElement("Raum")
raum_text = doc.createTextNode(tag_plan.get_unterricht(i)[2])
raum_elem.appendChild(raum_text)
stunde_elem.appendChild(thema_elem)
stunde_elem.appendChild(dozent_elem)
stunde_elem.appendChild(raum_elem)
tag_elem.appendChild(stunde_elem)
doc.documentElement.appendChild(tag_elem)
stri = doc.toprettyxml()
datei = open(dateiname, "w")
doc.writexml(datei, "\n", " ")
datei.close()
root = etree.fromstring(stri)
HTML(tree=root).write_pdf('weasyprint-website.pdf')