十五. Python基础(15)--内置函数-1 1 ● eval(), exec(), compile() 执行字符串数据类型的python代码 检测#import os 'import' in code ① eval : 有返回值, 适用于执行计算语句, 例如eval("4+3"). ② exec : 没有返回值, 适用于执行流程控制语句, 例如exec(a = b if b>c else c) ③ complie: code1 = 'for i in range(0,3):…
tkinter 的pack()可以设置的属性如下: pack_configure(self, cnf={}, **kw)Pack a widget in the parent widget. Use as options: after=widget - pack it after you have packed widgetanchor=NSEW (or subset) - position widget according to given d…
15.1 User-defined typesWe have used many of Python’s built-in types; now we are going to define a new type. As an example, we will create a type called Point that represents a point in two-dimensional space.In mathematical notation, points are often…