所以,我的项目有收据部分,它将打印出我页面上的所有食物清单。但我只想让这个只打印复选框的数量。这是我的代码。
def Receipt():
txtReceipt.insert(END,' \t\t *FAST FOOD CAFE* \n\n')
txtReceipt.insert(END,'Date: '+ DateofOrder.get() +'\n')
txtReceipt.insert(END,'Items\t\t\t\t'+"Cost of Items \n")
txtReceipt.insert(END,'Icecream:\t\t\t\t\t' + E_Icecream.get() +'\n')
txtReceipt.insert(END,'Donut:\t\t\t\t\t'+ E_Donut.get()+'\n')
txtReceipt.insert(END,'Softdrink:\t\t\t\t\t'+ E_Softdrink.get()+'\n')
txtReceipt.insert(END,'HotDog:\t\t\t\t\t'+ E_HotDog.get()+'\n')
txtReceipt.insert(END,'Pizza:\t\t\t\t\t'+ E_Pizza.get()+'\n')
txtReceipt.insert(END,'Taco:\t\t\t\t\t'+ E_Taco.get()+'\n')
txtReceipt.insert(END,'Hamburger:\t\t\t\t\t'+ E_Hamburger.get()+'\n')
txtReceipt.insert(END,'Fries:\t\t\t\t\t'+ E_Fries.get()+'\n')
txtReceipt.insert(END,'Wings:\t\t\t\t\t'+ E_Wings.get()+'\n')
txtReceipt.insert(END,'Cost of Drinks:\t\t\t\t'+ CostofDrinks.get()+'\nCost of Foods:\t\t\t\t'+ CostofFood.get()+"\n")
txtReceipt.insert(END,'Delivery Charge:\t\t\t\t'+ ServiceCharge.get()+'\nTotal Cost:\t\t\t\t'+str(TotalCost.get())+"\n")
txtReceipt.insert(END,'\nSpecial Request: '+ Request.get())