其他分享
首页 > 其他分享> > 一段脚本解读

一段脚本解读

作者:互联网

一段脚本解读

with open("../xl-20160426/Makefile") as f:
    lines = f.readlines()

打开文件Makefile,赋值给lines

lines[0] = "Q = "+str(q)+"\n" lines[1] = "M = "+str(m-1)+"\n" lines[2] = "N = "+str(n-m-2)+"\n" print("",lines[0],lines[1],lines[2]) with open("../xl-20160426/Makefile", "w") as f: f.writelines(lines) subprocess.run("cd ../xl-20160426; make", shell=True) subprocess.run("cp ../xl-20160426/xl .", shell=True)

 

标签:脚本,..,xl,Makefile,lines,解读,str,一段,20160426
来源: https://www.cnblogs.com/RicL/p/16644156.html