Re: [Tutor] Python Branches

2007-01-23 Thread Luke Paireepinart
vanam wrote: > > i started slowly learning python as i dont have much exposure to it > and i wanted to know what are all branches there in python actually i > installed py 2.5 recently i come across question in groups about the > gui where in pygtk should be installed.My question is without thi

[Tutor] Python Branches

2007-01-23 Thread vanam
i started slowly learning python as i dont have much exposure to it and i wanted to know what are all branches there in python actually i installed py 2.5 recently i come across question in groups about the gui where in pygtk should be installed.My question is without this installation could i ab

Re: [Tutor] Difference between filter and map

2007-01-23 Thread vanam
Yes i did a mistake in expressing my problem below are the instances of the script and its corresponding output,for each instance its giving contrasting result i want explanation for that [1]:def squ(n): return n*n filter(squ,range(3))>output is not seen on the interpreter ma

Re: [Tutor] OOP - have I done it right or could it be better?

2007-01-23 Thread Alan Gauld
"Original Brownster" <[EMAIL PROTECTED]> wrote > The program finds stream urls, downloads them, re-encodes them to > othe > formats, all this functionality I have created in one module with > one > class called Streamrip and methods to handle this. Good so far. One nitpick is that class names

Re: [Tutor] metaclass question

2007-01-23 Thread Kim Branson
Hi, what i've ended up doing is the following define a EmpiricalScore class that has all the methods for computing results define a single method in the evaluation class that is called Score. This method simply walks though a list and executes the methods in that list. There may be one

Re: [Tutor] OOP - have I done it right or could it be better?

2007-01-23 Thread Kent Johnson
Original Brownster wrote: > Hi, > I'm fairly new to using OOP and very new to Python, my first program is > coming along well and I have split the code into 2 modules. > > The program finds stream urls, downloads them, re-encodes them to othe > formats, all this functionality I have created in one

[Tutor] OOP - have I done it right or could it be better?

2007-01-23 Thread Original Brownster
Hi, I'm fairly new to using OOP and very new to Python, my first program is coming along well and I have split the code into 2 modules. The program finds stream urls, downloads them, re-encodes them to othe formats, all this functionality I have created in one module with one class called Streamri

[Tutor] Thanks

2007-01-23 Thread Carlos
Hello, I want to thank all you for the all help that you have been lending to me for the past months. My masters thesis is now finished and I have to say that it has been very succesfull. This is something that would have been impossible if not for all the help that you gave to me. I was thin

[Tutor] Question about structuring my pygtk program

2007-01-23 Thread Tino Dai
Hi Everybody, I have a question about structuring first pygtk program now that I have the basics working, I am moving to the next step of organizing my program so it doesn't turn into spaghetti code. Right now, what I'm doing is if a component of the GUI is used in more than one spot, I mak

Re: [Tutor] Variables of Variables

2007-01-23 Thread Tino Dai
*** Stuff deleted Wanted to give you an update. It is working now. Thank you ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Difference between filter and map

2007-01-23 Thread Chris Calloway
vanam wrote: > ya i am sure about that i am using python editor which has python > intrepreter attached to it i got the same output for both filter and map > def squ(n): >y = n*n > print y > filter(y,range(3))->0 1 4 > map(y,range(3))->0 1 4 You are not printing the result of either the fi

Re: [Tutor] Difference between filter and map

2007-01-23 Thread Chris Calloway
vanam wrote: > i want to know the difference between filter(function,sequence) and > map(function,sequence). >>> print filter.__doc__ filter(function or None, sequence) -> list, tuple, or string Return those items of sequence for which function(item) is true. If function is None, return the ite

Re: [Tutor] Difference between filter and map

2007-01-23 Thread Kent Johnson
vanam wrote: > ya i am sure about that i am using python editor which has python > intrepreter attached to it i got the same output for both filter and map > def squ(n): >y = n*n > print y > filter(y,range(3))->0 1 4 > map(y,range(3))->0 1 4 This is quite different that what you posted the

Re: [Tutor] Difference between filter and map

2007-01-23 Thread Danny Yoo
On Tue, 23 Jan 2007, vanam wrote: > i want to know the difference between filter(function,sequence) and > map(function,sequence). Hi Vanam, They may both take functions as input, but the intention of the functions is different. In the case of filter(), the input function is used to cull the

Re: [Tutor] Difference between filter and map

2007-01-23 Thread vanam
ya i am sure about that i am using python editor which has python intrepreter attached to it i got the same output for both filter and map def squ(n): y = n*n print y filter(y,range(3))->0 1 4 map(y,range(3))->0 1 4 On 1/23/07, Kent Johnson <[EMAIL PROTECTED]> wrote: vanam wrote: > i want t

Re: [Tutor] Difference between filter and map

2007-01-23 Thread Kent Johnson
vanam wrote: > i want to know the difference between filter(function,sequence) and > map(function,sequence).I tried for a simple script with an function > which finds the square of the number,after including separately filter > and map in the script i am getting the same results for instance > d

[Tutor] Difference between filter and map

2007-01-23 Thread vanam
i want to know the difference between filter(function,sequence) and map(function,sequence).I tried for a simple script with an function which finds the square of the number,after including separately filter and map in the script i am getting the same results for instance def squ(x): return x*x

Re: [Tutor] Some "type" confusion...

2007-01-23 Thread Kent Johnson
Gizmo wrote: > Hello > I am learning Python via the excellent Dive Into Python book. I have > little question > > 1) > >>> import os > >>> type(os.environ) > > > Why is this considered "instance" ? Should'nt it be "dict" type? > I have a feeling I am missing something deeper here. 'instance'

[Tutor] Some "type" confusion...

2007-01-23 Thread Gizmo
Hello I am learning Python via the excellent Dive Into Python book. I have little question 1) import os type(os.environ) Why is this considered "instance" ? Should'nt it be "dict" type? I have a feeling I am missing something deeper here. 2) What would happen if I did this os.environ = {}

Re: [Tutor] problem with canvas.postscript()

2007-01-23 Thread Michael Lange
On Mon, 22 Jan 2007 20:14:31 + "Asrarahmed Kadri" <[EMAIL PROTECTED]> wrote: > Hi folks, > > I am trying to save a tkinter canvas using canvas.postscript() method... > > The thing works fine when the canvas size is small; but it gets cut (from > the top and left side) when the size increases