[Tinyos-help] Arguments for Tython scripts

Cagatay Bilgin bilginc at ug.bilkent.edu.tr
Thu Mar 31 08:08:06 PST 2005


I'm not sure what the sys package is for but I use 
sim.argv[ ] to get the Tython script arguments.
Regards

----- Original Message ----- 
From: "Claussen, Joerg" <claussen at docomolab-euro.com>
To: <tinyos-help at Millennium.Berkeley.EDU>
Sent: Thursday, March 31, 2005 5:53 PM
Subject: [Tinyos-help] Arguments for Tython scripts


> Dear all,
> 
> I've got a problem passing arguments to Tython scripts.
> 
> I call SimDriver with this command:
> java net.tinyos.sim.SimDriver  -nosf  -seed 10000 -script
> "startup.py" -scriptargs '--n=12 --t=100';
> 
> The relevant parts of "startup.py" look like this:
> from sys import argv
> import sys
> 
> TIME = 2
> NODES = 2
> 
> argv = argv[1:]
> print argv
> 
> while argv:
>     a=argv[0]
>     if a.startswith("--t="):
>         TIME = a[4:]
>     elif a.startswith("--n="):
>         NODES = a[4:]
>     else:
>         print 'Wrong command line option'
>     argv = argv[1:]
> 
> The "print argv" command always returns []. It seems as if the arguments
> are not transferred?
> 
> Thanks for your help,
> Joerg
> 
> 
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help at Millennium.Berkeley.EDU
> http://mail.Millennium.Berkeley.EDU/mailman/listinfo/tinyos-help


More information about the Tinyos-help mailing list