【问题标题】:Try to simulate first.py of ns3 using netanim尝试使用 netanim 模拟 ns3 的 first.py
【发布时间】: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 “构建”成功完成(1.500 秒)
文件“scratch/first.py”,第 66 行
AnimationInterface netanim ("my_first.xml")
^ SyntaxError: 无效语法

请问我该如何解决这个错误?

【问题讨论】:

  • scratch/first.py 是什么样的? AnimationInterface netanim ("my_first.xml") 确实是无效语法。
  • 好的。什么是正确的语法? @ForceBru
  • 没有minimal reproducible example就无法判断

标签: python python-3.x ubuntu-18.04 ns-3


【解决方案1】:

我不使用 Python 绑定,但请查看手册中的 this page。您可能需要按照以下方式做一些事情

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-04
    相关资源
    最近更新 更多