Re: [Tutor] Re: The Game of Life

2005-01-06 Thread Kent Johnson
Brian van den Broek wrote: In an earlier version, instead of the run_world() method I now have, I put the following within my class definition and after (i.e. outside of) the method defs: .>while self.current_generation > self.total_generations: .>time.sleep(self.sleep_interval) .>

[Tutor] German Tutorials auf Deutsch

2005-01-06 Thread Kooser, Ara S
Title: German Tutorials auf Deutsch Pardon to the non-german speaking (or readers) on the list. Guten Tag. Mein Deutsch ist nicht so gut (ich habe keinen Deutsche in sieben Jahren geschreiben). Mann kann Python Tutorials auf Deutsch heir http://www.freenetpages.co.uk/hp/alan.gauld/german/ind

Re: [Tutor] trouble getting a list to update

2005-01-06 Thread Danny Yoo
On Thu, 6 Jan 2005, Vincent Wan wrote: > On Jan 6, 2005, at 12:59 PM, Danny Yoo wrote: > > Can you show us a snippet of the file output? I'm not immediately > > seeing anything particular with your debugging output statements: > > > Like the computer, I don't yet understand what the problem is.

[Tutor] Re: The Game of Life

2005-01-06 Thread Brian van den Broek
Hi all, after making the sketch I posted a bit ago, I tried to turn to actual work. But, the bug had bit. ;-) So, here is an attempt at filling out that sketch in an OOP way. (It is my second OOP program, so if anyone was so inclined, I'd very much appreciate any comments. Also, I have a question

Re: [Tutor] trouble getting a list to update

2005-01-06 Thread Vincent Wan
Dear Danny, On Jan 6, 2005, at 12:59 PM, Danny Yoo wrote: Can you show us a snippet of the file output? I'm not immediately seeing anything particular with your debugging output statements: Like the computer, I don't yet understand what the problem is. *grin* If you can point us at the outpu

Re: [Tutor] replacement for constants from other languages in Python?

2005-01-06 Thread Alan Gauld
> Compared to Java and C++, Python has very meager facilities > for controlling how code is used. There is no const, and only > the slightest nod to access control my > suggestion is, just relax and try the Python way! I'll second that. I came to Python after years of C++ (and Pascal - ev

RE: [Tutor] German Totorial!?!

2005-01-06 Thread Christian Meesters
Hoi Michael, Apart from Alan's tutorial in German and the link Andrew provided you might want to have a look here: http://python.sandtner.org/ (The German Python forum.) You'll find not only links to other German sources, but also friendly support in German ;-). Gruss, Christian

Re: [Tutor] trouble getting a list to update

2005-01-06 Thread Danny Yoo
On Thu, 6 Jan 2005, Vincent Wan wrote: > I wrote a program to repeatedly: > a: print a list of integers eg 0 0 0 0 0 0 0 0 0 0 > b: change each integer in the list to 1 with a .05% chance > > I run the program and over itterations more 1's appear as they should. > > However, the chan

Re: [Tutor] Looking for a project participate in (a little OT)

2005-01-06 Thread Alan Gauld
> I searched freshmeat.net but couldn't find anything interesting I guess that depends a bit on what you find intersting! But rather than frshmeat why not search source-forge? There are far more projects on source forge than those that get announced on freshmeat. And many are looking or people t

Re: [Tutor] Re: The Game of Life

2005-01-06 Thread Max Noel
On Jan 6, 2005, at 21:20, Brian van den Broek wrote: Oh, the Life rules allow a world where every cell will change in the next generation, iff your world is a torus (i.e. the lower row "touches" the upper row as if it were immediately above it, and the right column "touches" the left column

[Tutor] trouble getting a list to update

2005-01-06 Thread Vincent Wan
Dear All, I am trying to learn python and an having a problem. I wrote a program to repeatedly: a: print a list of integers eg 0 0 0 0 0 0 0 0 0 0 b: change each integer in the list to 1 with a .05% chance I run the program and over itterations more 1's appear as they should. Howeve

Re: [Tutor] Re: The Game of Life

2005-01-06 Thread Brian van den Broek
Max Noel said unto the world upon 2005-01-06 15:39: On Jan 6, 2005, at 20:05, Brian van den Broek wrote: I gave some thought (though produced no code) to the question of how to do a life game before you [Danny] posted your code. My naive approach differs a bit, and it seems to me better. I'd li

Re: [Tutor] Re: The Game of Life

2005-01-06 Thread Max Noel
First of all, thanks for answering our questions, Danny! And sorry for the lag before my reply, but I was rather busy over the last few days (moving "back" to the UK). On Jan 6, 2005, at 20:05, Brian van den Broek wrote: I am having a hard time figuring out how to efficiently snip and comment,

[Tutor] Re: The Game of Life

2005-01-06 Thread Brian van den Broek
Danny Yoo said unto the world upon 2005-01-03 04:11: On Mon, 3 Jan 2005, Brian van den Broek wrote: (Aside: one nonobvious example where copying can be avoided is in Conway's Game of Life: when we calculate what cells live and die in the next generation, we can actually use the 'Command' design p

Re: [Tutor] replacement for constants from other languages in Python?

2005-01-06 Thread Kent Johnson
Danny Yoo wrote: There are a few recipes in the Python Cookbook that mentions how to get a "const" mechanism in Python: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65207 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/197965 These require Python 2.1 and 2.3 respectively;

Re: [Tutor] automatically finding site-packages and python2.3 in a linux machine

2005-01-06 Thread Danny Yoo
> > I'm working on creating an installer for my program using install > > shield, and I'd like to know how one can automatically determine if > > Python 2.3 is installed on a linux machine Hi Fred, Sorry about ignoring parts of your question! Unix has default places for putting binaries like P

Re: [Tutor] replacement for constants from other languages in Python?

2005-01-06 Thread Danny Yoo
On Thu, 6 Jan 2005, Alan Gauld wrote: > > I'm _very_ used to using C style constants (preprocessor #define > > directives) or C++ const keyword style, for a variety of reasons. > > > > I've yet to see anything covering 'how to work around the lack of > > constants in Python'...can anyone point m

Re: [Tutor] automatically finding site-packages and python2.3 in a linux machine

2005-01-06 Thread Danny Yoo
On Thu, 6 Jan 2005, Fred Lionetti wrote: > I'm working on creating an installer for my program using install > shield, and I'd like to know how one can automatically determine if > Python 2.3 is installed on a linux machine, and where site-packages is > located (so that I can install my own file

Re: [Tutor] Array pointers

2005-01-06 Thread Alan Gauld
> Pixels - just ones and zeroes? Pack them as integers and apply the > right shift operator: > i>>=1 But you have to remember to overflow right hand ones into the next integer if there are more than 32 bits... Although Python long integers migfht work, dunno what the speed of shifting a long i

Re: [Tutor] replacement for constants from other languages in Python?

2005-01-06 Thread Alan Gauld
> I'm _very_ used to using C style constants (preprocessor #define > directives) or C++ const keyword style, for a variety of reasons. > > I've yet to see anything covering 'how to work around the lack of > constants in Python'...can anyone point me in the right direction here? Define "Constants"

[Tutor] automatically finding site-packages and python2.3 in a linux machine

2005-01-06 Thread Fred Lionetti
Hi everyone, I'm working on creating an installer for my program using install shield, and I'd like to know how one can automatically determine if Python 2.3 is installed on a linux machine, and where site-packages is located (so that I can install my own files there). For my Windows version I wa

[Tutor] Looking for a project participate in (a little OT)

2005-01-06 Thread Mark Kels
I'm learning python for a few months now, and I would like to get some experience by participating in a good, open source, and small python-CGI project. I searched freshmeat.net but couldn't find anything interesting (except __ but I think its dead...). Anyone knows of a good small and open source

Re: [Tutor] replacement for constants from other languages in Python?

2005-01-06 Thread Kent Johnson
Scott W wrote: Kent Johnson wrote: MINVERSION = repr(1.5) should work just fine. It will give the same result as the more readable MINVERSION = '1.5' Ok, this would make a bit more sense RE: repr()- in one of the resources I found, it seemed to state that repr(x) was converting x into a numeric re

Re: [Tutor] replacement for constants from other languages in Python?

2005-01-06 Thread Scott W
Kent Johnson wrote: Scott W wrote: The 'need' to define a global constant in an imported module, for example- (I know about sys.version_info, but it doesn't exist in 1.5.2...don't ask ;-) I also know this could be handled via a class, but what is the equivalent of the following snippets? Not s

Re: [Tutor] replacement for constants from other languages in Python?

2005-01-06 Thread Kent Johnson
Scott W wrote: The 'need' to define a global constant in an imported module, for example- (I know about sys.version_info, but it doesn't exist in 1.5.2...don't ask ;-) I also know this could be handled via a class, but what is the equivalent of the following snippets? Not so interested in sty

Re: [Tutor] The Game of Life

2005-01-06 Thread Kent Johnson
Danny Yoo wrote: There seems to be a fashionable push to introduce patterns early on in computer science education, perhaps because they are easy to put in as test questions. But despite this, I do think that there are some patterns that are worth seeing, even if they are in unrealistic toy situati

[Tutor] replacement for constants from other languages in Python?

2005-01-06 Thread Scott W
Hey all, I've done the usual googling, checked the Learning Python book and did some list searches, to no avail as of yet. I'm _very_ used to using C style constants (preprocessor #define directives) or C++ const keyword style, for a variety of reasons. I've yet to see anything covering 'how to