监控文件a,如有新内容写入,即时将新内容写入到新文件aa中: fw=open('e:\\aa.txt','ab') with open('e:\\a.txt','rb') as fo: while True: line = fo.readline() if line: fw.write(line) fw.flush() #即时将文件写入到磁盘 else: time.sleep(1) fo.seek(0,1) #1代表当前位置,0表示移动off个操作标记 fw.close() file.seek(
let body = document.querySelector("iframe").contentDocument.body; let observer = new MutationObserver((mutationsList, observer) => { for (let mutation of mutationsList) { if (mutation.removedNodes.length > 0) { console.log(mutation); conso