On 15/05/06, Kent Johnson <[EMAIL PROTECTED]> wrote:
> You can come pretty close with generators, though it hurts to think
> about what is actually going on behind the scenes here:
>
> In [1]: import itertools
>
> In [2]: def fibs():
> ...: yield 0
> ...: yield 1
> ...: fib1
John Fouhy wrote:
> On 15/05/06, w chun <[EMAIL PROTECTED]> wrote:
>> anyone know if list comps work the same way in haskell?
>
> Slightly not what you asked, but you can do some funky things with
> list comprehensions in Haskell.
>
> Check this out:
>
> fibs = 0 : 1 : [ a + b | (a, b) <- zip fi
On 15/05/06, w chun <[EMAIL PROTECTED]> wrote:
> anyone know if list comps work the same way in haskell?
Slightly not what you asked, but you can do some funky things with
list comprehensions in Haskell.
Check this out:
fibs = 0 : 1 : [ a + b | (a, b) <- zip fibs (tail fibs)]
The python transla
i agree with everyone above, kent, alan, roel... in fact, i have do a
doubletake everytime i write code like this and have to look things up
and/or play with some sample code as you all have done, just to make
sure i got it working. (kinda reminds of going back to look at a perl
script i wrote...
Alan,
Does that mean you will soon fix the tutor.tgz :-)
Thanks for all the hard work you put into this.
Stan.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
> How do I create the equivalent of a
Java class in Python? I've been looking> at the reference, and it's been
confusing to me at least.
Adapted from my book:
Java code:
class Msg{
private String
txt;
public Msg(String
s){
this.txt =
s;
}
public void
say(){
if
Hi,
I have managed to find the solution to my problem.
I have defined iter as
Iter = model.get_iter(combo3)
The code now works.
I will show it below for completeness:
combo3 = self.wTree.get_widget("treeview1")
model=gtk.TreeStore(gobject.TYPE_STRING,gobject.