Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1. #!/usr/bin/python
  2. import wx
  3. import subprocess
  4. import os
  5. import MySQLdb
  6. import json
  7.  
  8. db = MySQLdb.connect(host="localhost", port=3306, user="root", passwd="tester", db="linuxdev")
  9. cursor = db.cursor()
  10.  
  11. sql = ("SELECT * FROM users")
  12. cursor.execute(sql)
  13. data = cursor.fetchall()
  14.  
  15. data_string = json.dumps(data)
  16.  
  17. # main frame class
  18. class gunnp(wx.Frame):
  19.    
  20.     def __init__(self, parent, id):
  21.         wx.Frame.__init__(self, parent, id, "GNOME SQL Entry by GunnDawg", size = (570,300))
  22.  
  23.         panel = wx.Panel(self)
  24.  
  25.         wx.StaticText(panel, -1, data_string, (45, 25), style=wx.ALIGN_CENTRE)
  26.  
  27.  
  28. if __name__== "__main__":
  29.     app = wx.PySimpleApp()
  30.     frame = gunnp(parent = None, id = -1)
  31.     frame.Show()
  32.     app.MainLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement