0

I'm using traci, and everytime I call traci.start it prints "Loading configuration... done.". Its really annoying because I am connecting to a lot at once and overtime. I can't seem to find where this print originates. And attempting to disable prints on this traci.start call using something such as in this question does not work. I think because a sumo server is created which is connected to and this print comes from the code for this server.

Liger
  • 17
  • 7

1 Answers1

2

If you want to discard the complete stdout you can do the following:

import subprocess
import sumolib
import traci

PORT = sumolib.miscutils.getFreeSocketPort()
sumoProc = subprocess.Popen(["sumo", "-c", "sumo.sumocfg", "--remote-port", str(PORT)],
                            stdout=open(os.devnull, "w"))
traci.init(PORT)

This won't work with libsumo though.

Michael
  • 3,510
  • 1
  • 11
  • 23