Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import wx
- import subprocess
- import os
- import MySQLdb
- import json
- db = MySQLdb.connect(host="localhost", port=3306, user="root", passwd="tester", db="linuxdev")
- cursor = db.cursor()
- sql = ("SELECT * FROM users")
- cursor.execute(sql)
- data = cursor.fetchall()
- data_string = json.dumps(data)
- # main frame class
- class gunnp(wx.Frame):
- def __init__(self, parent, id):
- wx.Frame.__init__(self, parent, id, "GNOME SQL Entry by GunnDawg", size = (570,300))
- panel = wx.Panel(self)
- wx.StaticText(panel, -1, data_string, (45, 25), style=wx.ALIGN_CENTRE)
- if __name__== "__main__":
- app = wx.PySimpleApp()
- frame = gunnp(parent = None, id = -1)
- frame.Show()
- app.MainLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement