Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: iso-8859-15 -*-
- # generated by wxGlade 0.6.2 on Mon Jul 11 11:37:50 2011
- import wx
- import pymssql
- import os
- db=pymssql.connect(host='localhost',user='sysadm',password='sysadm',database='MISTRAL')
- cursor=db.cursor()
- sql1='SELECT * FROM ENTIDAD WHERE TIPO = 4 ORDER BY DESCRIPCION;'
- cursor.execute(sql1)
- resultado=cursor.fetchall()
- # begin wxGlade: extracode
- # end wxGlade
- class MyFrame(wx.Frame):
- def __init__(self, *args, **kwds):
- # begin wxGlade: MyFrame.__init__
- kwds["style"] = wx.DEFAULT_FRAME_STYLE
- wx.Frame.__init__(self, *args, **kwds)
- self.button_1 = wx.Button(self, -1, "Abrir")
- self.button_2 = wx.Button(self, -1, "Limpiar")
- self.button_3 = wx.Button(self, -1, "Cerrar")
- self.Bind(wx.EVT_BUTTON, self.abrir, self.button_1)
- self.Bind(wx.EVT_BUTTON, self.limpiar, self.button_2)
- self.Bind(wx.EVT_BUTTON, self.cerrar, self.button_3)
- self.__set_properties()
- self.__do_layout()
- # end wxGlade
- def __set_properties(self):
- # begin wxGlade: MyFrame.__set_properties
- self.SetTitle("Aplicacion")
- _icon = wx.EmptyIcon()
- _icon.CopyFromBitmap(wx.Bitmap("C:\\Documents and Settings\\ALMACEN\\Escritorio\\reportes python\\Iconos\\varios\\preferences-desktop-accessibility.png", wx.BITMAP_TYPE_ANY))
- self.SetIcon(_icon)
- self.SetBackgroundColour(wx.Colour(212, 208, 200))
- # end wxGlade
- def __do_layout(self):
- # begin wxGlade: MyFrame.__do_layout
- sizer_1 = wx.BoxSizer(wx.VERTICAL)
- grid_sizer_1 = wx.GridSizer(1, 3, 0, 0)
- grid_sizer_1.Add(self.button_1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0)
- grid_sizer_1.Add(self.button_2, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0)
- grid_sizer_1.Add(self.button_3, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0)
- sizer_1.Add(grid_sizer_1, 1, wx.EXPAND, 0)
- self.SetSizer(sizer_1)
- sizer_1.Fit(self)
- self.Layout()
- # end wxGlade
- def abrir(self,event):
- for registro in resultado:
- print registro[0] , '|' , registro[2]
- def limpiar(self,event):
- print "limpieza"
- def cerrar(self,event):
- self.Close()
- # end of class MyFrame
- if __name__ == "__main__":
- app = wx.PySimpleApp(0)
- wx.InitAllImageHandlers()
- frame_1 = MyFrame(None, -1, "")
- app.SetTopWindow(frame_1)
- frame_1.Show()
- app.MainLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement