摘要:
Python文本读取 按关键字查找文件内容,并保存为文件 from os import replace import re file = "d:/gdshnd_scm_0.txt" with open(file) as f: content = f.readlines() if content: f 阅读全文
摘要:
函数isinstance()可以判断一个变量的类型,既可以用在Python内置的数据类型如str、list、dict,也可以用在我们自定义的类,它们本质上都是数据类型。 假设有如下的 Person、Student 和 Teacher 的定义及继承关系如下: class Person(object): 阅读全文