Re: [Tutor] Newsreader list name?

2005-06-09 Thread Lee Cullens
Thanks for the reply Karl. In the last couple days I have carefully read through the Gmane site several times. I'm on OS X 10.4.1 and downloaded Hogwasher to try. Using my ISPs news server I found the two lists I mentioned, but I can't get anything nntp://news.gmane.org alone or in combin

Re: [Tutor] Newsreader list name?

2005-06-09 Thread Lee Cullens
I'm switching over from email digests to a newsreader and I can't find a reference for this tutor list. For example, I have the lists comp.lang.python and comp.lang.python.announce setup, but can't find something like comp.lang.python.tutor? There must be others on this list using a newsrea

Re: [Tutor] OO re-factoring (was Pythonese/Efficiency/Generalesecritique)

2005-06-08 Thread Lee Cullens
Javier, Allen, Kent, Liam Hmm, I think I understand what you all are saying. Basically, my familiar take on "code reuse" (the function model) as used in the utility is essentially not rewriting any more of a block than what is different, as opposed to "do all" blocks with convoluted switchi

Re: [Tutor] OO re-factoring (was Pythonese/Efficiency/Generalese critique)

2005-06-07 Thread Lee Cullens
le code structure to re-map is shaping up otherwise. Thanks, Lee C On Jun 8, 2005, at 1:10 AM, Javier Ruere wrote: > Lee Cullens wrote: > > >> I was thinking of extending the learning exercise by re-factoring it >> as an OO approach, since it would contain a minimum altered met

[Tutor] OO re-factoring (was Pythonese/Efficiency/Generalese critique)

2005-06-07 Thread Lee Cullens
In my original post I noted my recent exposure to Python and put up a little utility to my iDisk asking for a Pythonese/Efficiency/ Generalese critique. Javier, Kent and Liam were gracious enough to offer comments, which were greatly appreciated. To follow through with the learning exercis

Re: [Tutor] Pythonese/Efficiency/Generalese critique please

2005-06-05 Thread Lee Cullens
OK Kent - got it:My little formating function could be written as  (tested)  def cellpos(pname, alvl, blvl, clvl):        # breakout path components into list           pl = pname.split('/')        # insert empty cells for repeated names and        #  add new path components (cells) to csvline 

Re: [Tutor] Pythonese/Efficiency/Generalese critique please

2005-06-05 Thread Lee Cullens
Such would serve to pull the test and the reason for it together - more obvious. Which is a good point in writing code that others may read. Thanks Liam On Jun 5, 2005, at 9:29 AM, Liam Clarke wrote: > > > > There is no need for the if(dlst); if the list is empty the > iteration will do n

Re: [Tutor] Pythonese/Efficiency/Generalese critique please

2005-06-04 Thread Lee Cullens
Well, I've tried both and can't produce what I was doing with the for construct. With a listpl = ['a', 'b', 'c', 'd'] of the path components I'm trying to add justified non repeated path elements, say pl[2] and pl [3] to csvline so that csvline would end up '"",'*x plus '"c","d",' >>> pl

Re: [Tutor] Pythonese/Efficiency/Generalese critique please

2005-06-04 Thread Lee Cullens
On Jun 4, 2005, at 9:32 PM, Javier Ruere wrote: > Lee Cullens wrote: > >> The initial os.walk() approach I tried is simple in concept: >> >> pgo = os.walk(base_directory) >> for xnode in pgo: >> >> >> but I ended up with much more process

Re: [Tutor] Pythonese/Efficiency/Generalese critique please

2005-06-04 Thread Lee Cullens
Thanks for the critique Kent On Jun 4, 2005, at 6:54 PM, Kent Johnson wrote: > Lee Cullens wrote: > > >> Pythonese/Efficiency/Generalese critique please >> >> I'm new to Python and as an exercise created a little utility module. >> I'm learnin

Re: [Tutor] Pythonese/Efficiency/Generalese critique please

2005-06-04 Thread Lee Cullens
Sorry about the double post. I sent with the wrong from address so I resent with the correct address and before I could cancel the first the moderator had let it through :~) Lee C ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailm

Re: [Tutor] Pythonese/Efficiency/Generalese critique please

2005-06-04 Thread Lee Cullens
Thank you for the critique Javier. You made some good points that I will play with before moving on. Beyond that, I intentionally neglected error checking in this exercise as you may have surmised. Checking input arguments and handling access restrictions gracefully would indeed be important

Re: [Tutor] Pythonese/Efficiency/Generalese critique please

2005-06-04 Thread Lee Cullens
Thank you for the critique Javier. You made some good points that I will play with before moving on. Beyond that, I intentionally neglected error checking in this exercise as you may have surmised. Checking input arguments and handling access restrictions gracefully would indeed be important

[Tutor] Pythonese/Efficiency/Generalese critique please

2005-06-04 Thread Lee Cullens
Pythonese/Efficiency/Generalese critique pleaseI'm new to Python and as an exercise created a little utility module.  I'm learning from the O'Reilly books and updating that understanding from the 2.4 documentation.  The utility produces a csv file of a specified directory tree for import to a sprea

Re: [Tutor] increment operator

2005-05-27 Thread Lee Cullens
I find the following invaluable - maybe you will also. http://rgruet.free.fr/PQR24/PQR2.4.html Lee C On May 27, 2005, at 11:25 PM, Servando Garcia wrote: > Hello > Is there a increment operator in python similar to c++ > like so "SomeVariable++" > > __

Re: [Tutor] __init__.py

2005-05-22 Thread Lee Cullens
Joseph, I'm relatively new to Python, but I might be able to help with your question. First, think of the convention "self" (or sometimes "me" in other languages) as a reference to a specific instance derived from a class. When you reference an inherited class method of an instance, the

Re: [Tutor] Python debugger under Tiger?

2005-05-18 Thread Lee Cullens
Mike, You may not be looking for a commercial IDE, but I am very happy with WingIDE and using it with Tiger. Lee C On May 18, 2005, at 6:54 PM, Mike Hall wrote: > I should of specified that I'm looking for an IDE with full > debugging. Basically something like Xcode, but with Python support.

Re: [Tutor] Python Interest Group Query

2005-05-16 Thread Lee Cullens
Python Interest Group Query I'm aware of the Boston PIG, a smaller one in Amherst and have been told that there is possibly a PIG in Manchester, NH. Basically I'm trying to find out if there are any, or any interest in (or even any other Python users at all :~)) in a PIG in the northern NE

Re: [Tutor] import problem

2005-04-18 Thread Lee Cullens
I assume you mean PythonIDE for Python 2.3 (I usually use 2.4 and WingIDE). Here it is (indents screwed up with var font): HTH, Lee C Python 2.3 (#1, Sep 13 2003, 00:49:11) [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] Type "copyright", "credits" or "license" for more information. MacPyth

Re: [Tutor] for loop

2005-04-18 Thread Lee Cullens
> yes = 0 >>> for num in x: ... if 5 not in num: ... if not yes: ... print 'yes' ... yes = 1 ... yes On Apr 19, 2005, at 12:31 AM, Lee Cullens wrote: As you probably have already found out the expression >>> print [ e for e in x if 5 in e] will pro

Re: [Tutor] Newbie question

2005-04-18 Thread Lee Cullens
Thank you Brian for making the point that I did such a poor job of conveying. My post did indeed fail to clearly and concisely answer the question. Lee C On Apr 18, 2005, at 11:34 PM, Brian van den Broek wrote: Lee Cullens said unto the world upon 2005-04-18 21:07: That just gives you a spacer

Re: [Tutor] for loop

2005-04-18 Thread Lee Cullens
As you probably have already found out the expression >>> print [ e for e in x if 5 in e] will produce [[8, 4, 5, 6]] The problem with your original code is that you are printing 'yes' for each sub list until you encounter a sub list with 5 whereupon you break without printing yes. If you cha

Re: [Tutor] Newbie question

2005-04-18 Thread Lee Cullens
That just gives you a spacer line after your output. To see such as a separator change it to print '*'*10 On Apr 18, 2005, at 8:55 PM, Hoffmann wrote: Hi All: I am a newbie, and I am enjoying to study Python a lot. I have a question about an example I got from one of my books. The program is: d

Re: [Tutor] More Function Questions (Joseph Q.)

2005-04-17 Thread Lee Cullens
I think your looking at it too literally Joseph. Rather than any one example, think of a function as a block of code that is used in more than one place in your program. The x + y block of code is just a simplistic representation, intended to illustrate without the distracting complications o

Re: [Tutor] Re: Recursion....what are the best situations to use it?

2005-04-14 Thread Lee Cullens
It is really more of a question of the type of problem and the solution approach in general. For example, one can find the intersection of two lines with a simple equation, but that equation depends on the dimension the lines are in (2D, 3D, ...). If one were working in 2D space only, the

Re: [Tutor] Re: GUI module selection?

2005-04-13 Thread Lee Cullens
Thank you, Liam and Steve, for the informative feedback. Lee C ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Re: Interesting anomaly with the Eight Queens problem

2005-04-13 Thread Lee Cullens
, On Apr 13, 2005, at 1:04 PM, Lee Cullens wrote: John The type of problem you mention and the extent of positioning you go to could result in an incomplete solution. In very general terms one would need to place the first Queen then find an appropriate position for the second, and each of the

Re: [Tutor] Re: Interesting anomaly with the Eight Queens problem

2005-04-13 Thread Lee Cullens
John The type of problem you mention and the extent of positioning you go to could result in an incomplete solution. In very general terms one would need to place the first Queen then find an appropriate position for the second, and each of the remaining Queens in turn until either there are n

Re: [Tutor] Python backwards program (fwd)

2005-04-12 Thread Lee Cullens
for the slicing see: http://docs.python.org/lib/typesseq.html for a longhand loop approach see: http://docs.python.org/tut/node6.html#SECTION00620 On Apr 13, 2005, at 12:46 AM, Danny Yoo wrote: -- Forwarded message -- Date: Tue, 12 Apr 2005 22:37:44 -0500 From: J

[Tutor] Re: GUI module selection?

2005-04-12 Thread Lee Cullens
I'm trying to narrow down the detailed trials I need to go through in selecting basic GUI module approaches (just getting started in this Python "playground" - dev platform Mac OS X). Maybe these old eyes are just missing it, but I can't seem to satisfy my curiosity on the following: 1) Use o

Re: [Tutor] What is the best book to start?

2005-03-30 Thread Lee Cullens
I can only comment on what I know and I have the O'Reilly Python series which begins with the "Learning Python" book you have (if you have the 2nd ed.). Just getting started with Python myself. The first book has gone quite fast, but then I'm a retired software engineer. Even so, I think it

[Tutor] RE: Using IDLE on Mac OS X?

2005-03-29 Thread Lee Cullens
This is not a great way to start on this list, but I am having trouble with an annoyance that I have not been able to solve and have not found an answer to elsewhere. (Dual 2.5 Mac G5; 10.3.8; Python 2.3; retired software engineer getting started with Python) I don't like using Python via the