Re: Broadcast server

2006-08-31 Thread Matt Hammond
p and running, and with learning how to write your own components to make the system more sophisticated. We hang about on #kamaelia on freenode (irc) - please do drop in for a chat! Hope this helps! Matt -- | Matt Hammond | Research Engineer, Tech. Group, BBC, Kingswood Warren, Tadworth, Surrey, UK | http://kamaelia.sf.net/ | http://www.bbc.co.uk/rd/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Kamaelia 0.4.0 RELEASED - Faster! More Tools! More Examples! More Docs! ; -)

2006-06-26 Thread Matt Hammond
e is being pulled and pushed quite strongly by its inbox and outbox particles in many different directions at once. Matt -- | Matt Hammond | Research Engineer, Tech. Group, BBC, Kingswood Warren, Tadworth, Surrey, UK | http://kamaelia.sf.net/ | http://www.bbc.co.uk/rd/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple questions on use of objects (probably faq)

2006-03-08 Thread Matt Hammond
On Wed, 08 Mar 2006 11:29:29 -, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Wed, 08 Mar 2006 11:00:09 +, Matt Hammond wrote: > >>> 4: Can I avoid the dummy counter i in the for loop and do something >>> like: >>> yz=[y[:-1].x-y[1:].

Re: Simple questions on use of objects (probably faq)

2006-03-08 Thread Matt Hammond
4: Can I avoid the dummy counter i in the for loop and do something > like: > yz=[y[:-1].x-y[1:].x] yz = [e.x for e in y] yz.reverse() -- | Matt Hammond | R&D Engineer, BBC Research & Development, Tadworth, Surrey, UK. | http://kamaelia.sf.net/ | http://www.bbc.co.uk/rd/ -- http://

Re: how to improve this simple block of code

2006-01-11 Thread Matt Hammond
= x.rstrip(".") More concise, but slightly less readable IMO: if "." in x: x = x.rstrip("0").rstrip(".") -- | Matt Hammond | R&D Engineer, BBC Research & Development, Tadworth, Surrey, UK. | http://kamaelia.sf.net/ | http://www.bbc.co.uk/rd/ -- http://mail.python.org/mailman/listinfo/python-list

Re: how to improve this simple block of code

2006-01-11 Thread Matt Hammond
.") frac = frac.rstrip("0") if frac: x = x + "." + frac Copes if x = "132" too. If there'll always be a decimal point, then you can leave off the initial "if". Matt -- | Matt Hammond | R&D Engineer, BBC Research & Dev

Re: Addressing the last element of a list

2005-11-08 Thread Matt Hammond
gt; a = [5]; b = a >>> a[0] = 6 >>> a,b ([6], [6]) Note that reassigning a: >>> a = [6] causes a to point to a new list, containing the value 6, whereas the 2nd example above modified the list by replacing an element of it. Hope this helps Matt -- | Matt Hammond | R

Re: What is executed when in a generator

2005-10-04 Thread Matt Hammond
s less overheads, as it is not a true function call - stack frames etc are not having to be set up fully. Instead they are (presumably) set aside between calls to s.next() Hope this helps Matt -- | Matt Hammond | R&D Engineer, BBC Research & Development, Tadworth, Surrey, UK. | ht

Re: Thread's, async_chat and asyncore

2005-10-04 Thread Matt Hammond
ttp://kamaelia.sf.net/ ). There's some more introductory material and a tutorial or two which should give you a better idea about the system. We'd be interested to know what you think, and whether you think you could build your application using it. regards Matt -- | Matt Ha

Re: Wrapper module for Linux shared lib

2005-09-16 Thread Matt Hammond
greg/python/Pyrex/ -- | Matt Hammond | R&D Engineer, BBC Research & Development, Tadworth, Surrey, UK. | http://kamaelia.sf.net/ | http://www.bbc.co.uk/rd/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Bindings for Dirac, (sorta announcement)

2005-09-15 Thread Matt Hammond
pare them by following the instructions you'll find within comments in the example python program. regards Matt Hammond http://kamaelia.sf.net/ -- | Matt Hammond | R&D Engineer, BBC Research and Development, Tadworth, Surrey, UK. -- http://mail.python.org/mailman/listinfo/python-list

Re: scroll a frame to display several lines of widgets at a time

2005-09-02 Thread Matt Hammond
d 5 rows at a time? If the > latter, can I just grid over the previous 5 or do they have to be > explicitly removed first. > > Thanks. > > Bill -- | Matt Hammond | R&D Engineer, BBC Research and Development, Tadworth, Surrey, UK. -- http://mail.python.org/mailman/listinfo/python-list

Re: Yielding a chain of values

2005-08-31 Thread Matt Hammond
n expression too. x = yield in iterable Would behave like a list comprehension. x would be assigned a list containing the results of the successive yields. Equivalent to: x = [ yield r for r in iterable ] regards Matt -- | Matt Hammond | R&D Engineer, BBC Research and Developmen

Re: time.mktime problem

2005-08-30 Thread Matt Hammond
print t1, t2 -2208988799.0 -2208905776.0 >>> print t1-t2 -83023.0 Suse 9.3, python 2.4 (all 64bit) Matt -- | Matt Hammond | R&D Engineer, BBC Research and Development, Tadworth, Surrey, UK. -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert float to string ...

2005-08-23 Thread Matt Hammond
> How can i convert a float value into a string value? Try: string_value1 = str(float_value) + ' abc' or: string_value1 = repr(float_value) + ' abc' Type in an interactive python session. help(str) or: help(repr) regards Matt -- | Matt Hamm

Re: passing arguments from scale widget to function

2005-08-22 Thread Matt Hammond
ts it requires regards Matt -- | Matt Hammond | R&D Engineer, BBC Research and Development, Tadworth, Surrey, UK. -- http://mail.python.org/mailman/listinfo/python-list

Re: passing arguments from scale widget to function

2005-08-22 Thread Matt Hammond
so it fulfills the task. Note that we're passing "Calc" (the function itself), not "Calc(...)" (the result of calling the function) regards Matt -- | Matt Hammond | R&D Engineer, BBC Research and Development, Tadworth, Surrey, UK. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem (or even bug?) with Tkinter

2005-08-22 Thread Matt Hammond
d a way to make Tk cooperate better with SCIM. As a workaround for SUSE Linux 10.0 I might just unset XMODIFIERS during Tk's startup, so that at least typing ASCII will work. Altering the XMODIFIERS environment variable as he suggested solved the problem. -- | Matt Hammond | R&

Re: passing arguments from scale widget to function

2005-08-22 Thread Matt Hammond
rogrammer and do not wish to get involved in classes > and objects If you're using Tcl/Tk you're already using them ... what do you think your Slider widget is? :-) Hope this helps! regards Matt -- | Matt Hammond | R&D Engineer, BBC Research and Development, Tadwort

Re: Problem (or even bug?) with Tkinter

2005-08-19 Thread Matt Hammond
n2 -row 1 -column 1 > --- > > It is exactly the same as yours in tcl syntax. To execute it, just save > it to the file script.tcl and type in a shell: > wish script.tcl -- | Matt Hammond | R&D Engineer, BBC Research and Development, Tadworth, Surrey, UK. -- http://mail.python.org/mailman/listinfo/python-list

Problem (or even bug?) with Tkinter

2005-08-19 Thread Matt Hammond
ow) self.entry2.grid(row=1, column=1) x=ProblemGUI() x.window.mainloop() -- | Matt Hammond | R&D Engineer, BBC Research and Development, Tadworth, Surrey, UK. -- http://mail.python.org/mailman/listinfo/python-list

Re: Permutation Generator

2005-08-15 Thread Matt Hammond
osted incorrect permutation generators. > > Have you tried your code on some simple test cases? > > list(permute([1, 2, 3])) > ==> [[1, 2, 3], [2, 3, 1], [1, 3, 2], [3, 2, 1]] > > Notably absent from this list are [2, 1, 3] and [2, 3, 1]. The problem > gets worse with

Re: Why is this?

2005-08-12 Thread Matt Hammond
tances. Suppose I do concatenate two of the same object instance, then I get the same behaviour as with the multiply example: >>> T = [[]] >>> L = T + T >>> L[1].append(1) >>> L [[1], [1]] In fact, you could argue this is exactly what the multiply operation

Re: Why is this?

2005-08-12 Thread Matt Hammond
> old) gives: Ooops - you're absolutely right. I was cutting and pasting, but it seems I was a little overzealous with my editing! I've still got that in my terminal's history buffer, and it does indeed read: >>> [[], []] is [[]]*2 False -- | Matt Hammond |

Re: performance of recursive generator

2005-08-11 Thread Matt Hammond
o python it could optimise it away, eg: yield *inorder(t.left) ... but AFAIK there isn't :-( so I guess you'll have to avoid recursive generators for this app! Matt -- | Matt Hammond | R&D Engineer, BBC Research and Development, Tadworth, Surrey, UK. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is this?

2005-08-10 Thread Matt Hammond
s B". >>>> [[]]*2 > [[], []] >>>> [[], []] == [[]]*2 > True Same effect. But try the 'is' operator, to see if they are actually the same instances of 'empty list': >>>> [[], []] is [[]]*2 > True Hope this helps ... its my first go at explaining this kind of stuff, so apologies if it isn't as clear as it could be! Matt -- | Matt Hammond | R&D Engineer, BBC Research and Development, Tadworth, Surrey, UK. -- http://mail.python.org/mailman/listinfo/python-list

Re: Advanced concurrancy

2005-08-09 Thread Matt Hammond
allow transparent distribution of components in a >network... ;-) > I'll second that! regards Matt -- | Matt Hammond | R&D Engineer, BBC Research and Development, Tadworth, Surrey, UK. -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Kamaelia 0.2.0 released!

2005-08-08 Thread Matt Hammond
for whatever purpose. The potential for component re-use might mean less work for us! :-) regards Matt Hammond -- | Matt Hammond | R&D Engineer, BBC Research and Development, Tadworth, Surrey, UK. -- http://mail.python.org/mailman/listinfo/python-list

Re: Advanced concurrancy

2005-08-04 Thread Matt Hammond
Ooops! In case you're wondering who I am, I'm working on Kamaelia with Michael Sparks at the BBC. Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: Advanced concurrancy

2005-08-04 Thread Matt Hammond
Hi Stefan, > It seems as though all components basically have to do busy waiting now. You are right - components are, for the most part, busy-waiting. Which is not a good thing! > So do you plan on including a kind of scheduler-aware blocking > communication (like the `channels` of the `tasklets