摘要:
番号 阅读全文
摘要:
def file_replace(filename,old_word,new_word): f_read=open(filename) count=0 context=[] for eachLine in f_read: #print(eachLine) count+=eachLine.count(old_word) ... 阅读全文
摘要:
要求:用户输入文件名用户输入要显示的行数。例如,输入【10:20】,显示第10行到第20行。 【:20】 从第一行到第20行【10:】第10行到结尾 1 import os 2 3 def file_view(fileName,lineNum): 4 #判断文件是否存在 5 if fileName.strip()=="": 6 print("ERRO... 阅读全文