简体   繁体   English

TypeError:__init __()获得了意外的关键字参数“ columns”

[英]TypeError: __init__() got an unexpected keyword argument 'columns'

I am trying to create a plugin in wxpython and running into below error,can any one help understand why I am running into this error and how to fix this? 我正在尝试在wxpython中创建一个插件并遇到以下错误,有人可以帮助我理解为什么我遇到此错误以及如何解决此问题吗?

import wx
from wx.lib.agw import ultimatelistctrl as ULC 


class TestFrame(wx.App):
    def __init__(self):
        wx.App.__init__(self)
        APPNAME = 'plugin'
        self.frame = wx.Frame(None, -1, size=wx.Size(600,700), title=APPNAME, style=wx.DEFAULT_FRAME_STYLE)
        splitter = wx.SplitterWindow(self.frame, -1)
        splitter.SetMinimumPaneSize(180)
        panel1 = wx.Panel(splitter, size=wx.Size(-1, 300))
        commands_panel = wx.Panel(panel1, -1)
        package_panel = wx.Panel(commands_panel, -1)
        self.view_listctrl = ULC.UltimateListCtrl(package_panel, id=-1,columns=2,selectionType=1)
        package_vbox.Add(self.view_listctrl, 2, wx.EXPAND | wx.ALL, 5)
        #view_listctrl = ULC.UltimateListCtrl(package_panel, id=-1)
        itemCount = int('2')
        for x in range(0,itemCount):
            view_listctrl.SetItemKind(x, 2 , 1)

if __name__ == "__main__":
    app = wx.App(False)
    frame = TestFrame()
    app.MainLoop()

Error:- 错误:-

Traceback (most recent call last):
  File "listctr.py", line 26, in <module>
    frame = TestFrame()
  File "listctr.py", line 15, in __init__
    self.view_listctrl = ULC.UltimateListCtrl(package_panel, id=-1,columns=2,selectionType=1)
TypeError: __init__() got an unexpected keyword argument 'columns'

If you look at the documentation for the class's __init__ , you can see that it has no keyword argument columns , and yet you're trying to pass one: 如果查看该类的__init__的文档 ,您会发现它没有关键字参数 columns ,但是您尝试传递一个:

self.view_listctrl = ULC.UltimateListCtrl(package_panel, id=-1,columns=2,selectionType=1)

It's basically exactly what the error message is telling you. 这基本上就是错误消息告诉您的内容。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 TypeError at &#39;&#39; __init__() 得到一个意外的关键字参数 &#39;&#39; - TypeError at '' __init__() got an unexpected keyword argument '' 类型错误:__init__() 得到了意外的关键字参数“名称”-CONVOKIT - TypeError: __init__() got an unexpected keyword argument 'name' - CONVOKIT TypeError:__init __()获得了意外的关键字参数&#39;options&#39; - TypeError: __init__() got an unexpected keyword argument 'options' 类型错误:__init__() 得到了意外的关键字参数“after” - TypeError: __init__() got an unexpected keyword argument 'after' 类型错误:__init__() 得到了意外的关键字参数“i” - TypeError: __init__() got an unexpected keyword argument 'i' Scrapy错误:TypeError:__init __()获得了意外的关键字参数“回调” - Scrapy error: TypeError: __init__() got an unexpected keyword argument 'callback' 类型错误:__init__() 得到了一个意外的关键字参数“family_or_realsock” - TypeError: __init__() got an unexpected keyword argument 'family_or_realsock' Tensorboard TypeError:__ init __()得到一个意外的关键字参数&#39;file&#39; - Tensorboard TypeError: __init__() got an unexpected keyword argument 'file' TypeError:__ init __()获得了意外的关键字参数&#39;shape&#39; - TypeError:__init__() got an unexpected keyword argument 'shape' Python 3.5:TypeError:__ init __()得到了一个意外的关键字参数'nosigint' - Python 3.5 : TypeError: __init__() got an unexpected keyword argument 'nosigint'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM