zoukankan      html  css  js  c++  java
  • 第一个python的GUI程序

    http://www.cublog.cn/u/25372/showart_311088.html

    import sys, os
    import wx
    class main_window(wx.Frame):
         def __init__(self, parent, id, title):
             wx.Frame.__init__(self, parent, -1, title, size = (200, 100),
                               style=wx.DEFAULT_FRAME_STYLE|wx.NO_FULL_REPAINT_ON_RESIZE)
             self.control = wx.TextCtrl(self, -1, style=wx.TE_MULTILINE)
             self.Show(True)
             
    class App(wx.App):
     def OnInit(self):
      frame = main_window(None, -1, "Title")
      self.SetTopWindow(frame)
      return 1
        
    app = App(0)
    app.MainLoop()

      今天用网上某人的第一个python的GUI程序测试,结果有一个警告:

      Warning (from warnings module):
      File "D:\Python25\gui_test.py", line 2
        from   wxPython.wx import *
    DeprecationWarning: The wxPython compatibility package is no longer automatically generated or actively maintained.  Please switch to the wx package as soon as possible.

     改写为以上程序后,一切OK。

  • 相关阅读:
    CRM详细介绍网址
    element上传多图片
    多图片上传WebForm
    MemCached原理
    Redis的原理
    Ninject用法详解
    SQLsugar和unity 的用法
    json中的转义字符的处理
    fiddler
    orm多表关系
  • 原文地址:https://www.cnblogs.com/weiqi/p/1944624.html
Copyright © 2011-2022 走看看