Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: iso-8859-15 -*-
  3. # generated by wxGlade 0.6.2 on Mon Jul 11 11:37:50 2011
  4.  
  5. import wx
  6. import pymssql
  7. import os
  8.  
  9.  
  10.  
  11. db=pymssql.connect(host='localhost',user='sysadm',password='sysadm',database='MISTRAL')
  12. cursor=db.cursor()
  13.  
  14.  
  15. sql1='SELECT * FROM ENTIDAD WHERE TIPO = 4 ORDER BY DESCRIPCION;'
  16. cursor.execute(sql1)
  17. resultado=cursor.fetchall()
  18.  
  19.  
  20.  
  21.  
  22. # begin wxGlade: extracode
  23. # end wxGlade
  24.  
  25.  
  26.  
  27. class MyFrame(wx.Frame):
  28. def __init__(self, *args, **kwds):
  29. # begin wxGlade: MyFrame.__init__
  30. kwds["style"] = wx.DEFAULT_FRAME_STYLE
  31. wx.Frame.__init__(self, *args, **kwds)
  32.  
  33. self.button_1 = wx.Button(self, -1, "Abrir")
  34. self.button_2 = wx.Button(self, -1, "Limpiar")
  35. self.button_3 = wx.Button(self, -1, "Cerrar")
  36.  
  37. self.Bind(wx.EVT_BUTTON, self.abrir, self.button_1)
  38. self.Bind(wx.EVT_BUTTON, self.limpiar, self.button_2)
  39. self.Bind(wx.EVT_BUTTON, self.cerrar, self.button_3)
  40.  
  41.  
  42.  
  43. self.__set_properties()
  44. self.__do_layout()
  45. # end wxGlade
  46.  
  47. def __set_properties(self):
  48. # begin wxGlade: MyFrame.__set_properties
  49. self.SetTitle("Aplicacion")
  50. _icon = wx.EmptyIcon()
  51. _icon.CopyFromBitmap(wx.Bitmap("C:\\Documents and Settings\\ALMACEN\\Escritorio\\reportes python\\Iconos\\varios\\preferences-desktop-accessibility.png", wx.BITMAP_TYPE_ANY))
  52. self.SetIcon(_icon)
  53. self.SetBackgroundColour(wx.Colour(212, 208, 200))
  54. # end wxGlade
  55.  
  56. def __do_layout(self):
  57. # begin wxGlade: MyFrame.__do_layout
  58. sizer_1 = wx.BoxSizer(wx.VERTICAL)
  59. grid_sizer_1 = wx.GridSizer(1, 3, 0, 0)
  60.  
  61. grid_sizer_1.Add(self.button_1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0)
  62. grid_sizer_1.Add(self.button_2, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0)
  63. grid_sizer_1.Add(self.button_3, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0)
  64.  
  65.  
  66. sizer_1.Add(grid_sizer_1, 1, wx.EXPAND, 0)
  67. self.SetSizer(sizer_1)
  68. sizer_1.Fit(self)
  69. self.Layout()
  70. # end wxGlade
  71.  
  72.  
  73. def abrir(self,event):
  74. for registro in resultado:
  75. print registro[0] , '|' , registro[2]
  76.  
  77. def limpiar(self,event):
  78. print "limpieza"
  79.  
  80. def cerrar(self,event):
  81. self.Close()
  82.  
  83. # end of class MyFrame
  84.  
  85.  
  86. if __name__ == "__main__":
  87. app = wx.PySimpleApp(0)
  88. wx.InitAllImageHandlers()
  89. frame_1 = MyFrame(None, -1, "")
  90. app.SetTopWindow(frame_1)
  91. frame_1.Show()
  92. app.MainLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement