我正在尝试使用ConfigObj创建一个python .py文件。
我面临的问题如下 -
以下是我正在尝试使用的configspec文件的代码 - (是的,我正在使用OpenFlow) -
from mininet.topo import Topo, Node
class MyTopo( Topo ):
"Simple topology example."
def __init__( self, enable_all = True ):
"Create custom topo."
# Add default members to class.
super( MyTopo, self ).__init__()
[["Define_Nodes"]]
[[__many__]]
[["Add_nodes"]]
[[__many__]]
[["Add_edges"]]
[[__many__]]
# Consider all switches and hosts 'on'
self.enable_all()
topos = { 'mytopo': ( lambda: MyTopo() ) }
最后,当我运行此规范时,我的代码返回以下错误 -
in _handle_configspec
raise ConfigspecError('Parsing configspec failed: %s' % e)
ConfigspecError: Parsing configspec failed: Invalid line at line "1".
显然,这意味着我无法使用ConfigObj创建正确的configspec类型。
我的2点问题的任何答案都会很棒!