Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.76 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="*****", db="linuxdev")
  9. cursor = db.cursor()
  10.  
  11. sql = ("SELECT * FROM users")
  12. cursor.execute(sql)
  13.  
  14. row = cursor.fetchone()
  15.  
  16. data_string = 'id: {0}, username: {1}, password: {2}',format(*(1,'two', 'three))
  17.  
  18. # main frame class
  19. class gunnp(wx.Frame):
  20.    
  21.     def __init__(self, parent, id):
  22.         wx.Frame.__init__(self, parent, id, "GNOME SQL Entry by GunnDawg", size = (570,300))
  23.  
  24.         panel = wx.Panel(self)
  25.  
  26.         wx.StaticText(panel, -1, data_string, (45, 25), style=wx.ALIGN_CENTRE)
  27.  
  28.  
  29. if __name__== "__main__":
  30.     app = wx.PySimpleApp()
  31.     frame = gunnp(parent = None, id = -1)
  32.     frame.Show()
  33.     app.MainLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement