本文整理匯總了Python中Interpreter.translation方法的典型用法代碼示例。如果您正苦於以下問題:Python Interpreter.translation方法的具體用法?Python Interpreter.translation怎麽用?Python Interpreter.translation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Interpreter
的用法示例。
在下文中一共展示了Interpreter.translation方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: Printing_Screen
# 需要導入模塊: import Interpreter [as 別名]
# 或者: from Interpreter import translation [as 別名]
def Printing_Screen(self):
self.scrollbar = Scrollbar(self.frame)
self.scrollbar.grid(row=0, column=2, sticky=N+S)
self.printing_l = Text(self.frame)
self.printing_l.grid(row=0, column = 0)
self.scrollbar.config(command=self.printing_l.yview)
self.pause_b = Button(self.frame, text="Pause Printing", font=("Helvetica", 14),command= self.Pause_Screen)
self.pause_b.grid(row=1, column = 0, pady=10)
self.quit_b = Button(self.frame, text= "Quit Printing", font=("Helvetica", 14),command= self.to_quit)
self.quit_b.grid(row=2, column = 0, pady=10)
# Interpreter
self.display_message("Reading file...")
bricks = Interpreter.parsing(self.file.name)
Interpreter.translation(bricks)
self.display_message("Parsing file...")
build_order = Interpreter.generate_build_order(bricks)
self.display_message("Generating build order...")
#build_list = Interpreter.generate_build_list(build_order)
# Communication
self.display_message("Opening communication channel...")
com = Communicator()
com.setup_connection()
self.display_message("Communication established.")
self.display_message("Printing...")
bricks = com.print_bricks(build_order)
for instruction in bricks:
com.send_message(instruction[0], instruction[1])
com.close_connection()