一个好的python文件具有结构性,即文件中只含有class, if __name__ == "__main__".
mac中使用快捷键shift+option+鼠标选中

mac 打开网页,轻触鼠标两下(但是不按下去)是将某个局部区域放大,再轻触两下结束聚焦。
self.flag = "training" if train else "test"
split_symbol = "."
split_symbol.join(["www", "csdn", "com"])
/为分隔符拼接起来形成地址。data_root = os.path.join(root, "DRIVE", self.flag)
assert 断言,表示判断当前条件是否满足,如果不满足条件则直接触发异常,不必执行接下来的代码。
assert os.path.exists(data_root), "path {} does not exist.".format(data_root)
python中值的比较用 == , 地址的比较用is。python中整型和字符型是不可变对象,python会对其进行高速缓存。
>>> a = 1
>>> b = 1
>>> a == b
True
>>> a is b
True
>>> c = 1.0
>>> d = 1.0
>>> c == d
True
>>> c is d
False
>>> e = "abc"
>>> f = "abc"
>>> e == f
True
>>> e is f
True
>>> g = [1,2,3]
>>> h = [1,2,3]
>>> g == h
True
>>> g is h
False
>>> i = (1,2,3)
>>> j = (1,2,3)
>>> i == j
True
>>> i is j
False
参考: Python 中 is 的使用 https://blog.csdn.net/SAKURASANN/article/details/102882383