Jak*_*wit 3 python self defined python-3.x
回到同样令人困惑的脚本..我修复了很多间距问题......但似乎缺少更多?这有什么不对 - 它说的第332行self没有定义......
以下是脚本上方和下方的几行,以防重要:
#-Whats being decompiled start
#map(None,*list) = zip(*list)
class areaset(top_tsv):
def __init__(self, file_name=0, version=0):
top_tsv.__init__(self, file_name, version)
self.frombin_map = [ <--- this is 332
('ID' ,{'t':'ulong','lpad':0x04}),
('Name' ,{'t':'str','s':0x48,'rpad':0x1C}),
('RGB color' ,{'t':'color','rpad':0x01}),
('Sound effect ID' ,{'t':'long'}),
('Color RGB' ,{'t':'rcolor','rpad':0x01}),
('Lighting RGB value' ,{'t':'rcolor','rpad':0x01}),
('Lighting angle' ,{'t':'float','s':0x03,'f':0x01}),
('Is it City?' ,{'t':'ubyte','rpad':0x03}),
]
Run Code Online (Sandbox Code Playgroud)
我只是想不通,我现在想不到..还有很多其他的"自我未定义"错误,但如果我解决这个问题,那么至少我会知道如何解决其余问题.那么我需要做什么?
Lar*_*tig 10
如果代码摘录准确反映了程序中的内容,则问题在于__init__构造函数中只有一行.你需要修复你的缩进.
Self仅在成员函数中定义.您的非缩进代码不是构造函数的一部分,但实际上是在import您上课时运行.
其中的Python的大美人的是,它使用缩进来识别语句块,而不是花括号或begin,end.您必须正确使用缩进才能使解释器理解您的代码.
| 归档时间: |
|
| 查看次数: |
4747 次 |
| 最近记录: |