I'm experience something I think is a bug in the python sdk.

The problem appears using TOSSIM live, more precisely in "addChannels".

The normal way to use addChannels is apparently:
t.addChannel(c, sys.stdout)

Now I wanted to "decorate" the output I get with some color and filter it in 
some fancy ways.

In the python world normally it was enough to define a class that has a "write" 
method and pass it, like:
class MyOut(object):
      ....
      def write(self, msg):
         self.fp.write(msg)

But unfortunately addChannel wants a "real" file, not something that behaves 
like that.

So I also thought to give some different real file for every possible channel 
like this

for c in ("c1", "c2):
    t.addChannel(c, open(c + ".log", 'w'))

but it segfaults every time...
The file is an open file with 'w' exactly as the sys.stdout file, so why it 
doesn't like it?

Thanks a lot!
Andrea
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to