def size(entry, data): contents = entry.get() size = int(contents) data.width = size # ---------------------------------------------------------------------- # If this module is running at the top level (as opposed to being # imported by another module), then call the 'main' function. # ---------------------------------------------------------------------- if __name__ == '__main__': m0.main()
proximityleftbutton = ttk.Button(frame1, text='proximityleft') proximityleftbutton['command'] = (lambda: proximityleft(dc)) # right proximity sensor proximityrightbutton = ttk.Button(frame1, text='proximityright') proximityrightbutton['command'] = (lambda: proximityright(dc)) # middle proximity sensor proximitymiddlebutton = ttk.Button(frame1, text='proximitymiddle') proximitymiddlebutton['command'] = (lambda: proximitymiddle(dc)) bumpbothbutton.grid() bumpleftbutton.grid() bumprightbutton.grid() reflectanceleftbutton.grid() reflectancemiddlebutton.grid() reflectancerightbutton.grid() dc.darkness.grid(row=4, column=1) proximityleftbutton.grid() dc.distanceleft.grid(row=6, column=1) proximityrightbutton.grid() dc.distanceright.grid(row=7, column=1) proximitymiddlebutton.grid() dc.distancemiddle.grid(row=8, column=1) # ---------------------------------------------------------------------- # If this module is running at the top level (as opposed to being # imported by another module), then call the 'main' function. # ---------------------------------------------------------------------- if __name__ == '__main__': m0.main()