Re: [Tutor] Is this the right way to create a

2008-06-22 Thread Zameer Manji
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Kent Johnson wrote: > A User class that has a UserProfile as an attribute, and accessors for > Neighbors, etc, sounds good to me. You may want an Artist class, > probably not a Top Artists class. The User.getTopArtists() method > would access the web

[Tutor] Is this the right way to create a

2008-06-21 Thread Zameer Manji
I'm trying to create a library for the Last.fm webservice[1] and the first thing I created was a class for the Profile Information.[2] Is this the proper way of creating it? Is this useful to another programmer? import urllib import xml.etree.ElementTree as ET from BeautifulSoup import BeautifulSt

[Tutor] Learning Python from books

2008-06-19 Thread Zameer Manji
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Has anyone here attempted to learn Python from books ? I recently purchased "Learning Python" 3rd Edition (9780596513986) and if anyone here is a good bottom-up learner than it is the perfect book. The author goes over each feature in python, explain

[Tutor] Simple Python Projects ?

2008-05-27 Thread Zameer Manji
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Are there any simple python projects out there that have well documented code and are recommended for new users to read and modify ? I have created a few small programs on my own, but I feel that I will learn more now if I attempt to understand code

[Tutor] How to get a string from a DOM Text node ?

2008-05-25 Thread Zameer Manji
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 I'm trying to extract some information from the following xml file: http://pastebin.ca/1029125 This is the code that I have so far: import xml.dom.minidom file = "Music.xml" doc = xml.dom.minidom.parse(file) plist = doc.childNodes[1]

Re: [Tutor] while/if/elif/else loops

2005-11-01 Thread Zameer Manji
Ok after looking at everyones replies my program looks like this: #Coin Toss Game #Zameer Manji import random print "This game will simulate 100 coin tosses and then tell you the number of head's and tails" tosses = 0 heads = 0 tails = 0 while tosses<100: if tosses

[Tutor] while/if/elif/else loops

2005-10-31 Thread Zameer Manji
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 I'm new to programming and python. I've have recently been experimenting with while/if/elif/else loops and I've created a simple number guessing game. Now I want to create a coin tossing game, but I don't know how to structure it in python. The code