當前位置: 首頁>>代碼示例>>Python>>正文


Python HTML.generate_file方法代碼示例

本文整理匯總了Python中HTML.HTML.generate_file方法的典型用法代碼示例。如果您正苦於以下問題:Python HTML.generate_file方法的具體用法?Python HTML.generate_file怎麽用?Python HTML.generate_file使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在HTML.HTML的用法示例。


在下文中一共展示了HTML.generate_file方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: Html_Builder

# 需要導入模塊: from HTML import HTML [as 別名]
# 或者: from HTML.HTML import generate_file [as 別名]

#.........這裏部分代碼省略.........
					 command = self.html_has_body, onvalue = 1, offvalue = 0, height=4, \
					 width = 15)
		self.C1.pack()
		self.C2.pack()
		self.generate_button = Button(root, text='Generate HTML', command= self.make_file)
		self.generate_button.place(x=30, y=115)
		self.add_element_button = Button(root, text='Add Element', command = self.add_html_element)
		self.add_element_button.place(x=30, y=15)
		self.order_button = Button(root, text='Order Elements', command = self.order_html)
		self.order_button.place(x=30, y=75)
		self.delete_button = Button(root, text='Delete Element', command = self.delete_html)
		self.delete_button.place(x=30, y=45)
	
	def html_has_body(self):
		if(self.CheckVar2.get() == 1):
			self.html_object.has_body = True
		else:
			self.html_object.has_body = False
	
	def html_full(self):
		if(self.CheckVar1.get() == 1):
			self.html_object.is_full_html = True
		else:
			self.html_object.is_full_html = False

	def el_is_nested(self):
		if(self.check_is_nested.get() == 1):
			self.nested = True
		else:
			self.nested = False
	
	def make_file(self):
		self.html_object.generate_html()
		self.html_object.generate_file()
	
	def add_html_element(self):
		if(self.add_item == False and self.delete_something == False):
			self.option = StringVar()
			self.text_element = StringVar()
			self.option_list_pane = apply(OptionMenu, (root, self.option) + tuple(self.options_list))
			self.option.set(self.options_list[0])
			self.option_list_pane.place(x=20, y=200)
			self.add_button = Button(root, text='Add', width=7, command = self.add)
			self.add_button.place(x=175, y=450)
			self.text_element_box = Entry(root, textvariable=self.text_element)
			self.text_element_box.place(x=130, y=200)
			self.check_is_nested = IntVar()
			self.check_is_nested_button = Checkbutton(root, text = "Is Nested Element", variable = self.check_is_nested, \
						 command = self.el_is_nested, onvalue = 1, offvalue = 0, height=2, \
						 width = 14)
			self.check_is_nested_button.place(x=260, y=200)
			self.has_meta = IntVar()
			self.has_meta_button = Checkbutton(root, text = "Has Attributes", variable = self.has_meta, \
						 command = self.el_has_meta, onvalue = 1, offvalue = 0, height=2, \
						 width = 14)
			self.has_meta_button.place(x=260, y=275)
			self.add_item = True
		else:
			toplevel = Toplevel()
			label1 = Label(toplevel, text='Please finish your current action!', height=5, width=50)
			label1.pack()
	
	def el_has_meta(self):
		if(self.has_meta.get() == 1):
			self.meta = True
			self.meta_label = Label(root, text='Attribute Text:')
開發者ID:Trey50Daniel,項目名稱:HTMLBuilder,代碼行數:70,代碼來源:buildHTML.py


注:本文中的HTML.HTML.generate_file方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。