basaka 发表于 2008-12-31 18:26

回复 #10 jjj137 的帖子

恩,好的,那我先学wx吧,反正也不急着做什么东西。

luffy.deng 发表于 2008-12-31 22:47

没啥好不好的,个人爱好而已。我看pygtk就挺好

grissiom 发表于 2009-01-04 20:15

其实 pyqt4 文档也挺多的~ 网上就有很多教程~ 源码里自带一份 API,结合 qt4 自己的例程,看起来还是比较舒爽~

xolilo 发表于 2009-01-06 17:59

:P支持pytq4

lvxinzhi 发表于 2009-01-08 15:58

俺刚用wx写的

# --*-- encoding: UTF-8 --*--

import wx
import os
import wx.lib.dialogs

cmd_dbsvc = "C:\\win32\\dbsvc.exe"
cmd_dbsrv = "c:\win32\\dbsrv9.exe"
db_file = "C:\\Program Files\\Sybase\\SQL Anywhere 9\\asademo.db"
class InsertFrame(wx.Frame):

    def __init__(self, parent, id):
      wx.Frame.__init__(self, parent, id, u"Bceng 服务管理器",
                size=(380, 100),style=wx.SYSTEM_MENU |wx.CAPTION |wx.MINIMIZE_BOX |wx.CLOSE_BOX )
      panel = wx.Panel(self)

      bsvcReg = wx.Button(panel, label=u"注册服务", pos=(10, 10),
                size=(70, 50))
      bsvcStart= wx.Button(panel, label = u"启动服务", pos=(80,10),
                            size=(70,50) )
      bsvcDel = wx.Button(panel, label = u"删除服务", pos=(150,10),
                            size=(70,50))
      bsvcStop= wx.Button(panel, label=u"停止服务", pos=(220,10),
                            size =(70,50))
      bexit   = wx.Button(panel, label = u"退出", pos =(290,10),
                            size=(70,50))
      if os.path.exists(cmd_dbsvc) == False or os.path.exists(cmd_dbsrv) == False or os.path.exists(db_file) == False:
            bsvcReg.Enable(False)
            bsvcStart.Enable(False)
            bsvcDel.Enable(False)
            bsvcStop.Enable(False)

            
      self.Bind(wx.EVT_BUTTON, self.OnCloseMe, bexit)
      self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
      self.Bind(wx.EVT_BUTTON, self.OnSvcReg, bsvcReg)
      self.Bind(wx.EVT_BUTTON, self.OnSvcStop, bsvcStop)
      self.Bind(wx.EVT_BUTTON, self.OnSvcDel, bsvcDel)
      self.Bind(wx.EVT_BUTTON, self.OnSvcStart, bsvcStart)
   
    def OnCloseMe(self, event):
      self.Close(True)
    def OnSvcReg(self, event):
#      dbsvc -as -s auto -t network -w mynetworkserv "C:\Program Files\Sybase\SQL Anywhere 9\win32\dbsrv9.exe" -x tcpip -c 8m "C:\Program Files\Sybase\SQL Anywhere 9\sample.db"
      rtn = os.popen( cmd_dbsvc + " -as -s auto -t network -w BCENGSVC " + cmd_dbsrv + " -x tcpip -c 8m " + '"'+db_file+ '"')
      dlg = wx.lib.dialogs.scrolledMessageDialog(self, rtn.read(), u"提示")
      dlg.ShowModal()
      
      wx.MessageDialog(None,u"数据库服务器注册成功,请重新启动系统",u"提示")
      pass
    def OnSvcStop(self, event):
      dlg = wx.MessageDialog(None, u"确定要停止数据库服务器吗?",u"询问", wx.OK|wx.CANCEL|wx.ICON_WARNING)
      retCode = dlg.ShowModal()
      if retCode == wx.ID_CANCEL:return
      
      rtn = os.popen(cmd_dbsvc + " -x BCENGSVC" )
      dlg = wx.lib.dialogs.scrolledMessageDialog(self, rtn.read(), u"提示")
      dlg.ShowModal()
    def OnSvcDel(self, event):
      dlg = wx.MessageDialog(None,u"确定要删除服务吗?",u"警告",
                               wx.OK|wx.CANCEL|wx.ICON_WARNING )
      retCode = dlg.ShowModal()
      
      if retCode == wx.ID_OK:
            rtn = os.popen(cmd_dbsvc +" -y -d BCENGSVC")
            
            dlg = wx.lib.dialogs.scrolledMessageDialog(self, rtn.read(), u"提示")
            dlg.ShowModal()
      if retCode == wx.ID_CANCEL:
            print 'Cancel'
    def OnSvcStart(self, event):
      rtn = os.popen(cmd_dbsvc + " -u BCENGSVC")
      dlg = wx.lib.dialogs.scrolledMessageDialog(self, rtn.read(), u"提示")
      dlg.ShowModal()
    def OnCloseWindow(self, event):
      self.Destroy()

if __name__ == '__main__':
#    cmd_dbsvc = os.path.dirname(__file__)+os.sep + "dbsvc.exe"
#    tmp = os.popen(dbsvc)
    cmd_dbsvc = os.getcwd() + os.sep + "DB" + os.sep + "dbsvc.exe"
    cmd_dbsrv = os.getcwd() + os.sep + "DB" + os.sep + "dbsrv9.exe"
    db_file   = os.getcwd() + os.sep + "DB" + os.sep + "BCENG.db"
   
    app = wx.PySimpleApp()
    frame = InsertFrame(parent=None, id=-1)
    frame.Show()
    app.MainLoop()

rover12421 发表于 2009-01-17 14:09

不是很清楚,呵呵

future0906 发表于 2009-01-17 14:53

最近在看QT4 for C++,150MB左右的安装文件,可以装到1.5G多。。。。

可以想象文档和例子是非常多的。

Lonki 发表于 2009-01-18 15:28

只在Windows上干的话, 毫无疑问wx了, 原生控件. 和Windows编程很像, 有MFC基础更好, 没基础也不难的.

山野村夫 发表于 2009-01-21 23:42

偶觉得差不多

xiaonanln 发表于 2009-01-22 23:49

还是喜欢自带的tkinter,简单
页: 1 [2] 3 4 5 6 7 8 9 10
查看完整版本: 问一下wxPython or PyQt哪一个比较好?