StreamIndenter

(类来自 pyomo.common.formatting)

class pyomo.common.formatting.StreamIndenter(ostream, indent='    ')[source]

基础类:object

模拟一个文件类对象,它包装了另一个文件类对象,并在将所有数据传递给底层文件之前使用指定的字符串进行缩进。由于这提供了一个完整的文件接口,StreamIndenter对象可以任意嵌套。

__init__(ostream, indent='    ')[source]

方法

__init__(ostream[, indent])

write(data)

writelines(sequence)

成员文档