Re: [Tutor] parse text file

2010-06-01 Thread Steven D'Aprano
On Wed, 2 Jun 2010 07:40:33 am Colin Talbert wrote: > I am also experiencing this same problem. (Also on a OSM bz2 > file). It appears to be working but then partway through reading a > file it simple ends. I did track down that file length is always > 90 so it appears to be related

Re: [Tutor] OOP clarification needed

2010-06-01 Thread Steven D'Aprano
On Wed, 2 Jun 2010 06:19:17 am Jim Byrnes wrote: > Whenever I teach myself a new language I have great difficulty > understanding the nuts and bolts of it's OO implementation. Compared > to some older procedural languages I always end up becoming confused > by the large number of built in methods.

Re: [Tutor] Generating Birthdays

2010-06-01 Thread Steven D'Aprano
On Wed, 2 Jun 2010 08:04:13 am Benjamin Leddige wrote: > I have to create a program that generates random birthdays while > using lists. How do i go about doing this? Do i create two separate > lists for for the months and days or how can i go about writing this? If you didn't use a separate list

Re: [Tutor] Generating Birthdays

2010-06-01 Thread Alan Gauld
"Benjamin Leddige" wrote I have to create a program that generates random birthdays while using lists. This sounds like a homework assignment. We don't do homework for you but if you tell us what you've tried and where you are stuck we will try to make helpful suggestions. How do i go about

Re: [Tutor] OOP clarification needed

2010-06-01 Thread Alan Gauld
"Jim Byrnes" wrote Whenever I teach myself a new language I have great difficulty understanding the nuts and bolts of it's OO implementation. Do you understand the OO concepts OK? Is it only the language semantics you struggle with or the underlying OO concepts? some older procedural languag

[Tutor] Generating Birthdays

2010-06-01 Thread Benjamin Leddige
I have to create a program that generates random birthdays while using lists. How do i go about doing this? Do i create two separate lists for for the months and days or how can i go about writing this? Thanks _

Re: [Tutor] parse text file

2010-06-01 Thread bob gailer
On 6/1/2010 5:40 PM, Colin Talbert wrote: I am also experiencing this same problem. (Also on a OSM bz2 file). It appears to be working but then partway through reading a file it simple ends. I did track down that file length is always 90 so it appears to be related to some sort

Re: [Tutor] parse text file

2010-06-01 Thread Colin Talbert
I am also experiencing this same problem. (Also on a OSM bz2 file). It appears to be working but then partway through reading a file it simple ends. I did track down that file length is always 90 so it appears to be related to some sort of buffer constraint. Any other ideas? im

Re: [Tutor] OOP clarification needed

2010-06-01 Thread Steve Willoughby
On Tue, Jun 01, 2010 at 03:19:17PM -0500, Jim Byrnes wrote: > def viewer(imgdir, kind=Toplevel, cols=None): > win = kind() > > What is the relationship between kind=Toplevel in the first line and > win=kind() further down. Isn't "kind" a variable and "kind()" a method? kind is a variable.

[Tutor] OOP clarification needed

2010-06-01 Thread Jim Byrnes
Whenever I teach myself a new language I have great difficulty understanding the nuts and bolts of it's OO implementation. Compared to some older procedural languages I always end up becoming confused by the large number of built in methods. When reading through code examples I many times get

Re: [Tutor] matmolplot

2010-06-01 Thread Evert Rol
Sorry, forgot to reply-to-all previously. > Hi, > > I am trying to make plot using following code: > --- > for i in range(len(l2)): > plt.axvline(x=l1[i], ymin=0, ymax=l2[i], linewidth=2, color='r') axvline uses the [0, 1] range for it coordinates, not the coordinates set by the y-a

Re: [Tutor] matmolplot

2010-06-01 Thread Mark Lawrence
On 01/06/2010 14:14, saurabh agrawal wrote: Hi, I am trying to make plot using following code:---#!/usr/bin/pythonimport numpy as npimport matplotlib.pyplot as pltimport stringfrom pylab import savefigfrom sys import argv #input file as first argumentf1=argv[1]f = open(f1,'r')line=f.re

[Tutor] matmolplot

2010-06-01 Thread saurabh agrawal
Hi, I am trying to make plot using following code:---#!/usr/bin/pythonimport numpy as npimport matplotlib.pyplot as pltimport stringfrom pylab import savefigfrom sys import argv #input file as first argumentf1=argv[1]f = open(f1,'r')line=f.readlines()f.close() f2 = f1.split(".")#f3 = f2[

Re: [Tutor] playing game across internet: suggestions for design?

2010-06-01 Thread Alan Gauld
"Alex Hall" wrote Actually since there are only two players in Battleships you could dispense with a server and do a peer to peer game. When you say 'peer to peer', is this still with Python sockets? It sounds like what I am looking for! Yes, it just means both participants use the same pro