TypeError: this constructor takes no arguments
来源:互联网 发布:商家怎么投诉淘宝小二 编辑:程序博客网 时间:2024/06/03 18:29
from graphics import*
class child:
def _init_(self,win,center,radius,color):
self.w=win
self.p=center
self.r=radius
self.c=color
def show(self):
c=Circle(self.p,self.r)
c.setFill(self.c)
c.draw(self.w)
def setColor(self,color):
self.c=color
c.setFill(self.c)
from graphics import*
def main():
w=GraphWin()
A=child(w,Point(50,40),30,'blue')
A.show()
w.getMouse()
w.close()
main()
#TypeError: this constructor takes no arguments
错误原因:
构造函数,是两个下划线,不是一个!
0 0
- TypeError: this constructor takes no arguments
- TypeError: this constructor takes no arguments
- TypeError: this constructor takes no arguments
- python之TypeError: this constructor takes no arguments
- python:TypeError: this constructor takes no arguments解决方法
- TypeError: this constructor takes no arguments(Python 学习遇到的错误1)
- type error:this constructor takes no arguments的错误提示(python)
- python编绎程序中出现this constructor takes no arguments
- python 使用装饰器提示:TypeError: wrapper() takes no arguments (1 given)
- Python 3.5 + PyInstaller 3.2.1打包exe出错,TypeError: read() takes no keyword arguments
- TypeError: object() takes no parameters
- TypeError: object() takes no parameters
- TypeError: object() takes no parameters
- TypeError: object() takes no parameters
- TypeError: object.__new__() takes no parameters
- TypeError: object.__init__() takes no parameters
- python "TypeError: object() takes no parameters"
- This fragment should provide a default constructor (a public constructor with no arguments
- thinkphp 动态设置配置文件
- css 命名clas id
- mysql: Character set 'utf8mb4' is not a compiled character set and is not specified in the '/usr/sha
- 安卓配置文件SharedPreferences
- Android应用程序之桌面快捷方式
- TypeError: this constructor takes no arguments
- LeetCode - Best Time to Buy and Sell Stock II
- Linux下的socket建立
- 我好想出去玩啊 只是……
- android开发文件转载
- sharepoint 2010 使用水晶报表的完全方案。
- java线程的join,wait,notify深入理解
- android.transition
- 蓝桥杯初赛试题4