Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Can you call SUMO from a program (e.g., Python) rather than from the command line?

see https://docs.python.org/2/library/subprocess.html
The sumo tools make frequent use of this (e.g. for calling duarouter from within randomTrips.py).

Also, many of the sumo python tools (including randomTrips.py) are written so as to be reusable as a library.
In your python script you can do

import randomTrips
randomTrips.main(randomTrips.get_options(['-n', 'your.net.xml']))

regards,
Jakob
 

Am Mi., 3. Juli 2019 um 14:36 Uhr schrieb Richard Tasgal <tasgal@xxxxxxxxx>:
I'm trying to generate statistical data from a series of runs. 

Is there a way to call SUMO (also Netconvert and RandomTrips) from within a Python (or C or whatever other) program rather than from the command line? Python would be preferred because I use it to create the files with the nodes, the files with the edges, et al.  I don't see a way to start the runs other than from the command line. To do that automatically, as best I can tell, I need a batch script, with loops and other operations. I hate programming batch scripts!

Rich Tasgal

_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user

Back to the top