摘要: class MathMethod: def __init__(self,a,b): self.a = a self.b = b def add(self): print("我是父类的", self.a + self.b) def sub(self): print( self.a - self.b)c 阅读全文
posted @ 2022-03-28 23:39 狒狒桑 阅读(37) 评论(0) 推荐(0) 编辑
摘要: class BoyFriend: # 类属性 height = 175 weight = 120 money = "500万" def __init__(self, name, age): self.name = name self.age = age # 类函数 def cooking(self, 阅读全文
posted @ 2022-03-28 19:09 狒狒桑 阅读(21) 评论(0) 推荐(0) 编辑
摘要: import ostry: os.rmdir('aaa')except Exception as e: print(e)try: os.rmdir('aaa')except Exception as e: print(e) raisefinally: print('last')try: os.rmd 阅读全文
posted @ 2022-03-28 17:15 狒狒桑 阅读(6) 评论(0) 推荐(0) 编辑
摘要: import numpy as nparray1 = np.array([1,2,3,4])print(array1)array2 = np.array((1,2,3,4))print(array2)array3 = np.array([[1,2,3,4], [5,6,7,8]])print(arr 阅读全文
posted @ 2022-03-28 16:50 狒狒桑 阅读(19) 评论(0) 推荐(0) 编辑
摘要: # 遍历当前目录下所有文件 def read_file(path): if os.path.isdir(path): file_dirs = os.listdir(path) for file_dir in file_dirs: if os.path.isdir(os.path.join(path, 阅读全文
posted @ 2022-03-28 16:47 狒狒桑 阅读(51) 评论(0) 推荐(0) 编辑