本文介绍了对象没有属性显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经成功安装了 wxpython 并通过

I have installed wxpython successfully which i verified by

import wx

但是当我写代码时

import wx
class gui(wx.Frame):
    def __init__(self,parent,id):
        wx.Frame.__init__(self, parent,id,'Visualisation for Telecom Customer Data', size = (300,200))

if __name__ =='__main__':
    app = wx.PySimpleApp()
    frame = gui(parent = None, id = -1)
    frame.show()
    app.MainLoop()

显示错误

Traceback (most recent call last):
  File "D:\Bishnu\BE\4th year\7th semester\Major Project I\Workspace\Wxpython\default\GUI.py", line 13, in <module>
    frame.show()
AttributeError: 'gui' object has no attribute 'show'

可能的解决方案是什么?

what may be the solution ?

推荐答案

使用

frame.Show()

代替

frame.show()

python 中都区分大小写

all are case sensitive in python

这篇关于对象没有属性显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-05 07:33