#!/usr/bin/python
#-*- coding: utf-8 -*-

#calculator.py

import wx
import u3
import time
d = u3.U3 ()

        class Example (wx.Frame):

            def __init__ (self, parent, title):
                super (Example, self).__init__ (parent, title = title,
                        size = (400, 400))
                self.InitUI ()
          self.Centre ()
          self.Show ()def InitUI (self):

              menubar = wx.MenuBar ()fileMenu = wx.Menu ()menubar.Append (fileMenu, '&File')
        self.SetMenuBar (menubar)
        vbox = wx.BoxSizer (wx.VERTICAL)
        self.display = wx.TextCtrl (self, style = wx.TE_RIGHT)
        vbox.Add (self.display, flag = wx.EXPAND | wx.TOP | wx.BOTTOM, border = 4)
gs = wx.GridSizer (4, 4, 4, 4)
        self.button_1 = wx.Button (self, label = '1')
        self.button_2 = wx.Button (self, label = '2')
        self.button_3 = wx.Button (self, label = '3')
        self.button_4 = wx.Button (self, label = '4')
        self.button_5 = wx.Button (self, label = '5')
        self.button_6 = wx.Button (self, label = '6')
        self.button_7 = wx.Button (self, label = '7')
        self.button_8 = wx.Button (self, label = '8')
        self.button_9 = wx.Button (self, label = '9')
        self.button_10 = wx.Button (self, label = '10')
        self.button_11 = wx.Button (self, label = '11')
        self.button_12 = wx.Button (self, label = '12')
        self.button_13 = wx.Button (self, label = '13')
        self.button_14 = wx.Button (self, label = '14')
        self.button_15 = wx.Button (self, label = '15')
        self.button_16 = wx.Button (self, label = '16')
#gs.AddMany( [(wx.Button(self, label='1'), 0, wx.EXPAND),
                gs.AddMany ([(self.button_1, 0, wx.EXPAND),
                    (self.button_2, 0, wx.EXPAND),
                    (self.button_3, 0, wx.EXPAND),
                    (self.button_4, 0, wx.EXPAND),
                    (self.button_5, 0, wx.EXPAND),
                    (self.button_6, 0, wx.EXPAND),
                    (self.button_7, 0, wx.EXPAND),
                    (self.button_8, 0, wx.EXPAND),
                    (self.button_9, 0, wx.EXPAND),
                    (self.button_10, 0, wx.EXPAND),
                    (self.button_11, 0, wx.EXPAND),
                    (self.button_12, 0, wx.EXPAND),
                    (self.button_13, 0, wx.EXPAND),
                    (self.button_14, 0, wx.EXPAND),
                    (self.button_15, 0, wx.EXPAND),
                    (self.button_16, 0, wx.EXPAND)])
                vbox.Add (gs, proportion = 1, flag = wx.EXPAND) self.SetSizer (vbox)
#Bind an event for the button
                self.Bind (wx.EVT_BUTTON, self.led1 (), self.button_1)
                self.Bind (wx.EVT_BUTTON, self.led2 (), self.button_2)
        self.Bind (wx.EVT_BUTTON, self.led3 (), self.button_3)
        self.Bind (wx.EVT_BUTTON, self.led4 (), self.button_4)
        self.Bind (wx.EVT_BUTTON, self.led5 (), self.button_5)
        self.Bind (wx.EVT_BUTTON, self.led6 (), self.button_6)
        self.Bind (wx.EVT_BUTTON, self.led7 (), self.button_7)
        self.Bind (wx.EVT_BUTTON, self.led8 (), self.button_8)
self.Bind (wx.EVT_BUTTON, self.led9 (), self.button_9)
        self.Bind (wx.EVT_BUTTON, self.led10 (), self.button_10) if __name__
        == '__main__':

            app = wx.App ()Example (None, title = 'LED Control Panel') app.MainLoop ()
