ZL.c 发表于 2020-2-26 15:14:13

两天都没搞懂 求助


import myplane
bg=430,560
me= myplane.Myplane(bg)#这种类的引用有问题吗 为啥我会报错


File "d:\visualstudio\vs\common7\ide\extensions\microsoft\python\core\ptvsd_launcher.py", line 119, in <module>
    vspd.debug(filename, port_num, debug_id, debug_options, run_as)
File "d:\visualstudio\vs\common7\ide\extensions\microsoft\python\core\Packages\ptvsd\debugger.py", line 39, in debug
    run()
File "d:\visualstudio\vs\common7\ide\extensions\microsoft\python\core\Packages\ptvsd\__main__.py", line 316, in run_file
    runpy.run_path(target, run_name='__main__')
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\runpy.py", line 263, in run_path
    return _run_module_code(code, init_globals, run_name,
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\runpy.py", line 96, in _run_module_code
    _run_code(code, mod_globals, init_globals,
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
File "E:\飞机大战\main.py", line 19, in <module>
    me = myplanes.myplane(Bg_Size)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pygame\sprite.py", line 124, in __init__
    self.add(*groups)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pygame\sprite.py", line 142, in add
    self.add(*group)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pygame\sprite.py", line 142, in add
    self.add(*group)
TypeError: add() argument after * must be an iterable, not int

wp231957 发表于 2020-2-26 15:26:06

TypeError: add() argument after * must be an iterable, not int

必须是迭代,不能是int

ZL.c 发表于 2020-2-26 17:56:22

wp231957 发表于 2020-2-26 15:26
TypeError: add() argument after * must be an iterable, not int

必须是迭代,不能是int

为啥啊 我括号内填的是元组啊
页: [1]
查看完整版本: 两天都没搞懂 求助