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

2010-05-30 Thread Alex Hall
Hi all, While Battleship is not quite where I want it in terms of weapons, and while I await a response on another list to improve that, I figured I would at least start inquiries on the internet front. My plan is to let myself and a friend play each other at the game over the internet. I realize t

Re: [Tutor] Using Beautiful Soup to find an HTML element by its class attribute

2010-05-30 Thread Sithembewena Lloyd Dube
Thanks all, I found the solution: using the attributes dictionary as follows: weather_row = soup.findAll('tr', { "class" : "rs1" }) Many thanks. On Mon, May 31, 2010 at 1:32 AM, Sithembewena Lloyd Dube wrote: > Hi everyone, > > I am using urllib to scrape an HTML page, and creating an instance

[Tutor] Using Beautiful Soup to find an HTML element by its class attribute

2010-05-30 Thread Sithembewena Lloyd Dube
Hi everyone, I am using urllib to scrape an HTML page, and creating an instance of BeautifulSoup as follows: * *from BeautifulSoup import BeautifulSoup import re, urllib doc = urllib.urlopen(my_url).read() soup = BeautifulSoup(''.join(doc)) #print soup.prettify() weather_row = soup.findAll('tr',

[Tutor] Using Beautiful Soup to find an HTML element by its class attribute

2010-05-30 Thread Sithembewena Lloyd Dube
Hi everyone, I am using urllib to scrape an HTML page, and creating an instance of BeautifulSoup as follows: * *from BeautifulSoup import BeautifulSoup import re, urllib doc = urllib.urlopen(" http://weather.za.msn.com/local.aspx?wealocations=wc:SFXX0010&q=Cape+Town%2c+Western+Cape ").read() soup

Re: [Tutor] PYTHON ON NOKIA E71

2010-05-30 Thread Luke Paireepinart
On Sun, May 30, 2010 at 1:17 PM, Dipo Elegbede wrote: > Hi all, > Pls does anyone know whether I can install python and code on my Nokia E71? > I have full access to computer at my office but not at home. This is > creating a serious break in my flow of study. > With python on my phone,I can learn

[Tutor] PYTHON ON NOKIA E71

2010-05-30 Thread Dipo Elegbede
Hi all, Pls does anyone know whether I can install python and code on my Nokia E71? I have full access to computer at my office but not at home. This is creating a serious break in my flow of study. With python on my phone,I can learn and code on the fly. Already,I read Alan Gauld's note from my ph

Re: [Tutor] namespaces

2010-05-30 Thread Matthew Wood
That's probably my least favorite error message in python. I wish that somehow it would have the line number of the first assignment statement instead of the first read statement. I know why it's not that way, but I just wish it weren't. -- I enjoy haiku but sometimes they don't make sense; ref

Re: [Tutor] namespaces

2010-05-30 Thread Robert Johansson
Thanks Evert for pointing out the difference and the discussion on global variables, it helped. /Robert -Ursprungligt meddelande- Från: Evert Rol [mailto:evert@gmail.com] Skickat: den 30 maj 2010 18:34 Till: Robert Johansson Kopia: tutor@python.org Ämne: Re: [Tutor] namespaces H

Re: [Tutor] namespaces

2010-05-30 Thread Evert Rol
Hi Robert > This code generates the message “UnboundLocalError: local variable 'doubles' > referenced before assignment” (line: if d[0] == d[1] and doubles == 2:) > > http://pastebin.com/mYBaCfj1 > > I think I have a fair picture of what it means but I would be very happy if > someone co

[Tutor] namespaces

2010-05-30 Thread Robert Johansson
Hi, This code generates the message "UnboundLocalError: local variable 'doubles' referenced before assignment" (line: if d[0] == d[1] and doubles == 2:) http://pastebin.com/mYBaCfj1 I think I have a fair picture of what it means but I would be very happy if someone could explain the d

Re: [Tutor] SENTINEL, & more

2010-05-30 Thread Alan Gauld
"spir ☣" wrote in *The* issue is custom objects don't know their names. The objects don't have names. They are referenced by names. But the name has nothing to do with the object it references. If multiple names reference the same object which name is the object supposed to associate itself w

Re: [Tutor] class methods as static methods?

2010-05-30 Thread Alex Hall
On 5/30/10, Alan Gauld wrote: > "Alex Hall" wrote > >> that it will hit. I would like to not instantiate a Harpoon object, >> just call the Harpoon's getImpactCoords method and pass it the >> required arguments. Is this possible? > > Others have pointed out that > a) This is possible using static

[Tutor] Uploading a file (non-form)

2010-05-30 Thread Timo
Hello, I am searching and searching and searching and ... Still haven't found the solution. Basicly, I want to upload a file to my http server. The user shouldn't have to do anything for this, so a userform on my webpage is a no-go. For just text, I managed to do it with a form, but fill it in au

Re: [Tutor] SENTINEL, & more

2010-05-30 Thread spir ☣
On Sun, 30 May 2010 00:36:24 +0200 Eike Welk wrote: > Hey Denis! > > I waited for a thread like this to appear, because I have a quirky, but IMHO > elegant, solution for those kinds of variables: > > class EnumMeta(type): > def __repr__(self): > return self.__name__ > > class

Re: [Tutor] class methods as static methods?

2010-05-30 Thread Alan Gauld
"Alex Hall" wrote that it will hit. I would like to not instantiate a Harpoon object, just call the Harpoon's getImpactCoords method and pass it the required arguments. Is this possible? Others have pointed out that a) This is possible using staticmetjhod or classmetjod decorators and b) it s