Re: [Tutor] Read-create-edit file

2009-12-13 Thread bibi midi
Here's the link: http://paste.debian.net/53933/ On Mon, Dec 14, 2009 at 6:10 AM, bibi midi wrote: > > > Yes my bad, found out too late. Sorry for that. Will post in pastebin or > equal and give the link. > > > -- > Best Regards, > bibimidi > > -- Best Regards, bibimidi __

Re: [Tutor] Read-create-edit file

2009-12-13 Thread bibi midi
On Mon, Dec 14, 2009 at 6:09 AM, bibi midi wrote: > > > On Mon, Dec 14, 2009 at 1:17 AM, Rich Lovely wrote: > >> >> First of all it's too long to paste into an email, especially if >> you'rte using a client that strips leading whitespace. Paste it into >> a pastebin. I personally prefer python.

Re: [Tutor] Read-create-edit file

2009-12-13 Thread bibi midi
On Mon, Dec 14, 2009 at 1:17 AM, Rich Lovely wrote: > > First of all it's too long to paste into an email, especially if > you'rte using a client that strips leading whitespace. Paste it into > a pastebin. I personally prefer python.codepad.org, as it lets you > test code on the server, unless i

Re: [Tutor] Read-create-edit file

2009-12-13 Thread Rich Lovely
2009/12/13 biboy mendz : > Hi list, > > I finally manage to sort of complete my read-create-edit.py file (after > finding precious free time). I appreciate your review and good/bad comments > to my code. It look and runs ok from my side here :-) > > -- > Regards, > bibs M. > > Host/Kernel/OS  "cc0

[Tutor] Read-create-edit file

2009-12-13 Thread biboy mendz
Hi list, I finally manage to sort of complete my read-create-edit.py file (after finding precious free time). I appreciate your review and good/bad comments to my code. It look and runs ok from my side here :-) #read_create_edit.py #!/usr/bin/env python # -*- coding: utf-8 -*- ''' Exercise 3

Re: [Tutor] Learning Python

2009-12-13 Thread David
Hi, Kent Johnson wrote: > Python in a Nutshell is good if you want a compressed but readable > introduction. I am thinking of buying this one, but the topical 2nd edition is from 2006. Does anyone know if a new version, covering Python 3, is coming to market soonish? David

Re: [Tutor] Learning Python

2009-12-13 Thread Emile van Sebille
On 12/13/2009 4:36 AM Grigor Kolev said... Your __init__ looks OK. All the other methods return either self.list or (with sort and append) return None because you've reassigned self.list to the return value of self.list.sort() and self.list.append()(both sort and append methods change the ob

Re: [Tutor] Learning Python

2009-12-13 Thread Alan Gauld
"Grigor Kolev" wrote My answer is: class MyList (): def __init__(self, value=[]): self.list=[] for i in value: self.list.append(i) def __add__(self , other): return self.list def __mul__(self , other): return self .list def __delitem__(self ,

[Tutor] Learning Python

2009-12-13 Thread Grigor Kolev
It is from book Learning Python Operator overloading. Write a class called Mylist that shadows (“wraps”) a Python list: it should overload most list operators and operations, including +, indexing, iteration, slicing, and list methods such as append and

Re: [Tutor] What I do wrong

2009-12-13 Thread Martijn Arts
What doesn't work, does it have errors, etc.! On Sun, Dec 13, 2009 at 12:25 PM, Grigor Kolev wrote: > class MyList (): >def __init__(self, value): >self.value = [] >for x in value: >self.value.append(x) >def __add__(self , ot

[Tutor] What I do wrong

2009-12-13 Thread Grigor Kolev
class MyList (): def __init__(self, value): self.value = [] for x in value: self.value.append(x) def __add__(self , other): return MyList(self.value+other) def __mul__(self , other): retu