Re: [Tutor] Strange Question

2006-04-29 Thread Danny Yoo
> First, I think this is a wonderful list. I always see great advice and > great attitudes about helping. > > My post is not about evaluating code but instead trying to get a > reasonable judgment as to whether or not python is the best choice for > what I am trying to do. I have not learned

[Tutor] Strange Question

2006-04-29 Thread GNULinuxGeek
All, First, I think this is a wonderful list.  I always see great advice and great attitudes about helping. My post is not about evaluating code but instead trying to get a reasonable judgment as to whether or not python is the best choice for what I am trying to do.  I have not learned Pytho

Re: [Tutor] how to *really* copy a list

2006-04-29 Thread kevin parks
Ed, I should have realized that the nesting would create the problem, but i didn't have that in mind... i always thought that the difference between extend and append was that extend did not yield a nested list. I really need to revisit this issue and get it right in my mind. It is a 'gotcha'

Re: [Tutor] how to *really* copy a list

2006-04-29 Thread kevin parks
John, Thanks. Your message was very helpful. I will tattoo it to my forehead. hehe... i notice that the "learning python" book also explains so of this and i shall study that as well cheers, kevin On Apr 27, 2006, at 10:14 PM, [EMAIL PROTECTED] wrote: > > On 28/04/06, kevin parks <[EMAIL P

Re: [Tutor] cycle w/ shuffle

2006-04-29 Thread kevin parks
Thanks Kent. That is what i did the first time around but it didn't work ... but that was do to something else that was not working in the script hehe of course, this just shuffles the saved copy of the list which is egg-zactly what i needed "duh" ... sorry... gosh... -kevin-- On Apr

Re: [Tutor] How Big Is Too Big?

2006-04-29 Thread Liam Clarke
Hi John, For longer programmes, if posting here, I recommend using something like www.rafb.net/paste; having syntax highlighted (and not butchered by webmail!) is a great help. Regards, Liam Clarke On 4/29/06, John Connors <[EMAIL PROTECTED]> wrote: > G'day, > > Just wondering how many lines of

Re: [Tutor] question concerning deepcopy

2006-04-29 Thread Gregor Lingl
Kent Johnson schrieb: > Gregor Lingl wrote: > >>Thanks, Kent for the hint. It works (of course). >>Skimming through this part of the docs I discovered, that there is a >>special method __deepcopy__. So I also tried using this, adding >> >> def __deepcopy__(self,visit): >> r

Re: [Tutor] Silly Dice Game

2006-04-29 Thread Alan Gauld
"John Connors" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > ... thinking of something to program and then knowing if what I have > written could be done more efficiently. The first one is hardest to ansdwer, but anything repetitive that you do on a regular basis should be a cand

Re: [Tutor] How Big Is Too Big?

2006-04-29 Thread Alan Gauld
> Just wondering how many lines of code is the maximum > to post in the list to have it critiqued. > Would about 100 lines of code be considered too much? 100 lines is probably about the top end just on the basis of how long it takes to read and comment on. As Kent says the longer the code the le

Re: [Tutor] Silly Dice Game

2006-04-29 Thread John Connors
G'day John, >If I were you, I would look at separating more of my program out into >functions. Good use of functions will make your program more >readable, easier to debug, and easier to change, should the rules of >your dice game change :-) Yes, the rules change on a regular basis, usually by t

Re: [Tutor] Silly Dice Game

2006-04-29 Thread John Fouhy
On 30/04/06, John Connors <[EMAIL PROTECTED]> wrote: > The wife and I play a silly dice game and I thought it would be a good > challange for me to write it as a program. No specific question, just > wondering if my technique is ok and is there anything that could be done > better. The 2 hardest th

[Tutor] Silly Dice Game

2006-04-29 Thread John Connors
G'day, The wife and I play a silly dice game and I thought it would be a good challange for me to write it as a program. No specific question, just wondering if my technique is ok and is there anything that could be done better. The 2 hardest things I find as a python beginner who has no real

Re: [Tutor] How Big Is Too Big?

2006-04-29 Thread Kent Johnson
John Connors wrote: > G'day, > > Just wondering how many lines of code is the maximum to post in the list to > have it critiqued. I realise people are using their own time to help others > in here for no real personal gain and I would hate to impose on their > goodwill. Would about 100 lines of

[Tutor] How Big Is Too Big?

2006-04-29 Thread John Connors
G'day, Just wondering how many lines of code is the maximum to post in the list to have it critiqued. I realise people are using their own time to help others in here for no real personal gain and I would hate to impose on their goodwill. Would about 100 lines of code be considered too much?

Re: [Tutor] question concerning deepcopy

2006-04-29 Thread Kent Johnson
Gregor Lingl wrote: > Thanks, Kent for the hint. It works (of course). > Skimming through this part of the docs I discovered, that there is a > special method __deepcopy__. So I also tried using this, adding > > def __deepcopy__(self,visit): > return self > > to my Vec clas

Re: [Tutor] question concerning deepcopy

2006-04-29 Thread Gregor Lingl
Kent Johnson schrieb: > Gregor Lingl wrote: > >>Hi all of you, ... >>> from copy import deepcopy >> >>> class Vec(tuple): >> def __new__(cls, x, y): >> return tuple.__new__(cls, (x,y)) >> def __abs__(self): >> return (self[0]**2+self[1]**2)**0.5 >> ##