在python中使用with open as 结构,嵌套打开两个文件
如 with open(fb,'r') as fb ,open(fq,'r') as fq:
python
require 'redcarpet'
markdown = Redcarpet.new("with open(fb,'r') as fb ,open(fq,'r') as fq:")
puts markdown.to_html
若是采用for循环分别读取两个文件,for循环往往只有一层循环可用
另一层只迭代了一次