Douglas S. Blank wrote:
Belinda,
I don't remember the details, but I know that pyrobot stores the string
argument to -a in gui.engine.args . You'll have to parse it, maybe
something like:
args = gui.engine.args.split(",")
for a in args:
name, value = a.split.("=")
I forget how you get the gui object from a brain (I'm on the road right
now), but maybe that will give you a pointer. More later...
You can get the args from inside a brain with:
self.engine.args
and then use code like that above. For example:
$ bin/pyrobot -a "this is a test"
>>> self.engine.args
'this is a test'
-Doug
-Doug
On Thu, March 8, 2007 10:25 pm, belinda thom said:
Hi,
I asked this question a couple months ago, and didn't get an answer,
so I'm trying again.
Hw can one pass info into a world file from the command line?
For instance, if I try:
42 % pyrobot -a foo=test -s PyrobotSimulator -w BsWorld.py -r
PyrobotRobot60000 -b BraitenbergVehicle1.py &
[1] 5536
and then put an
import sys
print sys.argv
into my world file, and i see:
['/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/
site-packages/pyrobot/plugins/simulators/PyrobotSimulator',
'5536', 'BsWorld.py']
which looses the info about foo=test that the -a argument passes to
something.
Thanks,
--b
_______________________________________________
Pyro-users mailing list
[email protected]
http://emergent.brynmawr.edu/mailman/listinfo/pyro-users
_______________________________________________
Pyro-users mailing list
[email protected]
http://emergent.brynmawr.edu/mailman/listinfo/pyro-users