Warm tip: This article is reproduced from serverfault.com, please click

python-尝试使用netanim模拟ns3的first.py

(python - Try to simulate first.py of ns3 using netanim)

发布于 2020-11-28 11:44:30

你能帮我解决以下错误吗
ubuntu @ ubuntu:〜/ Desktop / ns-allinone-3.32 / ns-3.32 $ ./waf --pyrun scratch / first.py
Waf:进入目录/home/ubuntu/Desktop/ns-allinone-3.32/ns-3.32/build' Waf: Leaving directory / home / ubuntu / Desktop / ns-allinone-3.32 / ns-3.32 / build'构建命令将存储在build / compile_commands.json中“ build”成功完成(1.500s)
文件“ scratch / first.py”,第66行
AnimationInterface netanim(“ my_first.xml “)
^ SyntaxError:语法无效

我该如何解决此错误?

Questioner
Afra Arif
Viewed
0
Sagar 2020-12-12 10:41:53

我不使用Python绑定,而是从手册中浏览此页面你可能需要按照以下步骤进行操作

anim = ns.netanim.AnimationInterface("my_first.xml")