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
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
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:].
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://
= 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
.")
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
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
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
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
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
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
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
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
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
> 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
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
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
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&
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
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
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
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
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
> 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
|
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
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
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
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
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
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
30 matches
Mail list logo