【发布时间】:2017-04-01 00:26:06
【问题描述】:
我是 mininet 的新手。我想运行 mininet 命令以从“节点”、“转储”等 python 脚本运行。我可以创建拓扑,但不能通过我的脚本使用这些命令。我正在使用 Ubuntu 14.04。
import subprocess as sb
import os
print "Single Switch and 4 Hosts per switch topology"
print "Creation of topology"
os.system(" sudo mn --topo = single,4",shell=True)
os.system("nodes")
错误:
sh: 1: nodes: not found
32512
我不想通过python脚本创建拓扑,我只想使用mininet命令。
【问题讨论】:
-
mininet 有一个 pythonic API。您是否有理由要使用 bash 调用它?