Re: [Tutor] Hy, I'm a n00b to Python, have some questions

2005-07-18 Thread André Roberge
Alex Nedelcu wrote: [snip] > > Also, why is www.python.org so ugly :) ? If I'd > like to point others to learn Python I would need a site that markets > Python through eye-candy case studies, not some boring old site :). Just > joking. I don't want to give examples of ot

Re: [Tutor] Performance difference, ``in'' vs ``has_key()''

2005-07-17 Thread André Roberge
Max Noel wrote: > [snip] > > > While we're on that topic, is there a particular reason why 'in', > in a dict context, searches the keys instead of doing the logical thing > and searching the values? animals = { 'cat': "a cuddly little mammal who likes to eat birds", 'dog': "man's best fr

[Tutor] ANN: Version 0.9 of RUR-PLE

2005-05-31 Thread André Roberge
Version 0.9 of RUR: a Python Learning Environment has been released. Information about RUR-PLE can be obtained at http://rur-ple.sourceforge.net Note that the project website is slightly out of date. Among the changes in this new version: ***Spanish translation added.* Changed image for languag

Re: [Tutor] Dictionary Inserts...

2005-05-05 Thread André Roberge
Allen John Schmidt, Jr. wrote: > Ok, I have had enough. I have looked all through the python docs and I > cannot find it. How do you insert an entry into a dictionary? > > Thanx! > >>> my_dict = {} >>> my_dict['new_entry'] = ['simple', 'as', 1, 2, 3] >>> my_dict {'new_entry': ['simple', 'as'

[Tutor] Re: primes

2005-03-17 Thread André Roberge
[EMAIL PROTECTED] wrote: Quoting Gregor Lingl <[EMAIL PROTECTED]>: [x for x in range(2,100) if not [y for y in range(2,x) if x%y==0]] Heh. That's quite neat. I can only offer one suggestion --- if you replace range with xrange, you get a small speed improvement. eg: On my system, it took 415 sec

[Tutor] Using exec with dict

2005-01-30 Thread André Roberge
Thank you Kent. That worked. André Roberge wrote: / I have a "robot" that can do some actions like "move()" and />/ "turn_left()". I can program this robot using python like this: />/ />/ .def move_and_turn(): [snip]// />/ The qu

[Tutor] Using exec with dict

2005-01-30 Thread André Roberge
First things first: I am writing a program which has, among other things, an embedded Python interpreter. So, before telling me that "using exec is unsafe because one could enter <...>", consider that the user could just as well enter <...> in the interpreter. (Having gotten this off my chest

[Tutor] Re: [ANN] RUR: a Python Learning Environment (alpha)

2004-12-13 Thread André Roberge
This is weird (to me, anyways) as it works well on my computer. However, I remember that I had to create "loadImages()" to initialize the handlers early on, otherwise it was complaining that it couldn't "ConvertToBitmap". I'll have to see if I can move this statement elsewhere; I will reply private

[Tutor] Re: [ANN] RUR: a Python Learning Environment (alpha)

2004-12-13 Thread André Roberge
This looks like a very nice effort -- I am trying to get it running, since I am working with some other newbies to learn more Python. I wish there were a link from http://rur-ple.sourceforge.net/index.html to the download page! I will fix that; thanks. And I am not sure which of the downloaded f

[Tutor] [ANN] RUR: a Python Learning Environment (alpha)

2004-12-12 Thread André Roberge
ython program (other than some very simple ones) and the first program I share with anyone. Comments, suggestions, criticisms are most welcome. André Roberge ___ Tutor maillist - [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/tutor