Re: [Tutor] Tkinter on OS X
"Kent Johnson" <[EMAIL PROTECTED]> wrote I'm pretty sure that page is out-of-date, Tkinter does not require X11, it is integrated with Aqua. This is true, as a recent posting confirmed re the limitations of colouring buttons under Aqua. But... Tkinter has a reputation as quick and ugly. Thats a good description in my experience. And on Aqua it still isn't as slick as some other toolkits. there may be ways to make it look better You can make Tkinter look OK on any platform but it takes an inordinate amount of timwe to tweak all the settings on every widget. looks you might want to choose a different toolkit. wxPython, PyQt and PyGTK all have their proponents. If cross platform compatibility isn;t important then considr using the Cocoa bindings for MacOS X. You can't get any more native than that and you get the advantage of being able to use XCode as your GUI BUilder. But it won't work on anything but a Mac! HTH, Alan G ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Is this the right way to create a
"Zameer Manji" <[EMAIL PROTECTED]> wrote Also, how do I then begin to approach the whole API ? Do I create a User class the inherits from the UserProfile class and other classes for their Neighbours', Top Artists, etc ? I don;t know enough about the underlying service to answer that but... Do a create a separate class for each web service ? Web services are usually procedural in nature so that you don't need to create classes at all. So to provbide maximum flexibility you might be better just creating a module that exposes the services as functions. The users can then create their own classes built on the underlying API functions. If you do want to go with classes, think about how you would ideally like to use the API to build applications. Try writing some simple applications as if the classes existed. Calling the methods you would want to have. Then go back and build those classes. Design from the outside in for maximum usability. And of course it might be a good idea to do both things. Write the basic module that handles all the SOAP and networking stuff then write the user friendly classses on top of that as a separate module. HTH, -- Alan Gauld Author of the Learn to Program web site http://www.freenetpages.co.uk/hp/alan.gauld ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Is this the right way to create a
On Sun, Jun 22, 2008 at 4:03 AM, Alan Gauld <[EMAIL PROTECTED]> wrote: > Web services are usually procedural in nature so that you don't > need to create classes at all. So to provbide maximum flexibility > you might be better just creating a module that exposes the > services as functions. The users can then create their own classes > built on the underlying API functions. In this case I think you would at least want to make a class to hold the results of the call because there are so many fields to return. Kent ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Is this the right way to create a
On Sun, Jun 22, 2008 at 12:00 AM, Zameer Manji <[EMAIL PROTECTED]> wrote: > 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 BeautifulStoneSoup as BSS > BASEURL = 'http://ws.audioscrobbler.com/1.0/user/' > class UserProfile(object): >"""Represents the user profile data""" >def __init__(self, username): >"""Give the username""" >self.username = username >def getxmldata(self): >url = BASEURL + self.username + '/profile.xml' >self.xmldata = urllib.urlopen(url).read() >def parsedata(self): >soup = BSS(self.xmldata) >self.url = soup.url.string > This looks like a good start. A few things I would change: - getxmldata() will be shared among all your API routines so you might make it a separate function that returns the data instead of assigning it to an attribute. - This class is probably not very useful without the parsed data so you might call getxmldata() & parsedata() from the constructor (__init__() method). There is no reason to make client code call these. You certainly don't want your client code to have to call getxmldata() and parsedata() both in the correct order. - You might want to use one of the two common naming conventions for your methods, either getXmlData() or get_xml_data(). A couple of other ways you could organize this that might be useful: - Have the UserProfile constructor take a BeautifulSoup node as its argument. Then have a separate function that gets and parses the XML. This wil be a useful structure for Artists, for example, because you have to parse lists of Artists. - alternately, you could have a function that pokes values into a UserProfile. > Also, how do I then begin to approach the whole API ? Do I create a User > class the inherits from the UserProfile class and other classes for > their Neighbours', Top Artists, etc ? Do a create a separate class for > each web service ? I have never coded something like this before and all > advice is welcome. 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 services API and return a list of Artists. At a first guess, it looks like you may want classes for each of the types listed under "Categories" on the Web Services page. Pull as much of the web services code into shared functions as possible (or possibly a utility class). For example, you will probably want a function that creates a list of Artists from a parsed XML page. Kent ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] From Newbie
Hi ! I have learned wiki tutor for non-programmer and I found some hill that stopping me. In Non-Programmer's Tutorial for Python/Count to 10, wiki ask me to write this code : a = 1 s = 0 print 'Enter Numbers to add to the sum.' print 'Enter 0 to quit.' while a != 0: print 'Current Sum:', s a = int(raw_input('Number? ')) s = s + a print 'Total Sum =', s But when i write while a != 0: and then i press enter, python terminal tell me : >>> while a ! = 0: File "", line 1 while a ! = 0: ^ SyntaxError: invalid syntax Can you find my mistake, guys ? Sorry to bother you, I try to find the answer in google, but I can't found the answer. Please help me soon guys, whatever your answer. If you don't want to answer my question, please give me some site that could answer this newbie question. Thank's. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] From Newbie
But when i write while a != 0: and then i press enter, python terminal tell me : while a ! = 0: File "", line 1 while a ! = 0: ^ SyntaxError: invalid syntax Can you find my mistake, guys ? Sorry to bother you, I try to Hi, Python's trying to give you a hint: while a ! = 0: ^ SyntaxError: invalid syntax So, there's something it doesn't like around the `!' character. Compare the error message to what you say you wrote: while a != 0: Notice any differences? Best, Brian vdB ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] From Newbie
On Sun, Jun 22, 2008 at 6:45 AM, Danny Laya <[EMAIL PROTECTED]> wrote: > Hi ! I have learned wiki tutor for non-programmer and I found some hill that > stopping me. In Non-Programmer's Tutorial for Python/Count to 10, wiki ask > me to write this code : > > a = 1 > s = 0 > print 'Enter Numbers to add to the sum.' > print 'Enter 0 to quit.' > while a != 0: > print 'Current Sum:', s > a = int(raw_input('Number? ')) > s = s + a > print 'Total Sum =', s > The above code, copy/pasted to a file, and run from the command-line gives the following output: Enter Numbers to add to the sum. Enter 0 to quit. Current Sum: 0 Number? 1 Current Sum: 1 Number? 2 Current Sum: 3 Number? 3 Current Sum: 6 Number? 4 Current Sum: 10 Number? 0 Total Sum = 10 > But when i write while a != 0: and then i press enter, > python terminal tell me : while a ! = 0: > File "", line 1 > while a ! = 0: > ^ > SyntaxError: invalid syntax > > Can you > find my mistake, guys ? Sorry to bother you, I try to > find the answer in google, but I can't found the answer. > Please help me soon guys, whatever your answer. If you don't > want to answer my question, please give me some site that could > answer this newbie question. Thank's. > The syntax error seems to be the space between the '!' and the '='. '!=' means 'does not equal' '! =' doesn't mean anything, thus, the syntax error. When you're beginning, you'll make plenty of errors like that. Stop and read the error carefully, then look at the code closely. As you gain experience, you'll learn to see those nit-picky syntax errors. It doesn't matter which computer programming language you start out with, each one has a specific syntax that must be followed, or you'll get syntax errors. Python is very friendly, and the error messages it gives you are much more helpful than other languages. Happy Programming! -- b h a a l u u at g m a i l dot c o m Kid on Bus: What are you gonna do today, Napoleon? Napoleon Dynamite: Whatever I feel like I wanna do. Gosh! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] From Newbie
Few... Thanks all, i have found the wrong, i miss some space between != and 0. Thank's for the help. I really apreciate it ! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] From Newbie
hi Danny,As far as i am aware you must declare your variable first, something like a=0The same would go for shope that helpspaulOn Sun Jun 22 10:45 , Danny Laya sent:Hi ! I have learned wiki tutor for non-programmer and I found some hill that stopping me. In Non-Programmer's Tutorial for Python/Count to 10, wiki ask me to write this code :a = 1s = 0print 'Enter Numbers to add to the sum.'print 'Enter 0 to quit.'while a != 0:print 'Current Sum:', sa = int(raw_input('Number? '))s = s + aprint 'Total Sum =', sBut when i write while a != 0: and then i press enter, python terminal tell me :>>> while a ! = 0: File "", line 1while a ! = 0:^SyntaxError: invalid syntaxCan you find my mistake, guys ? Sorry to bother you, I try to find the answer in google, but I can't found the answer.Please help me soon guys, whatever your answer. If you don'twant to answer my question, please give me some site that couldanswer this newbie question. Thank's. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] [Fwd: Re: From Newbie]
On Sun, June 22, 2008 7:55 am, [EMAIL PROTECTED] wrote: > hi Danny, > > > As far as i am aware you must declare your variable first, something like > a=0 That's a good thought. But he did initialize his variable. The '!' and the '=' in '!=' are all smashed together without spaces. So: > while a ! = 0: Should be: while a != 0: That should get you going again. Marilyn Davis > > The same would go for s > > > hope that helps > > paul > > On Sun Jun 22 10:45 , Danny Laya sent: > > > > > > Hi ! I have learned wiki tutor for non-programmer and I found some hill > that stopping me. In Non-Programmer's Tutorial for Python/Count to 10, > wiki ask me to write this code : a = 1 s = 0 print 'Enter Numbers to add to > the sum.' print 'Enter 0 to quit.' while a != 0: print 'Current Sum:', s a = > int(raw_input('Number? ')) s = s + a print 'Total Sum =', s > > But when i write while a != 0: and then i press enter, > python terminal tell me : while a ! = 0: > File "", line 1 > while a ! = 0: ^ > SyntaxError: invalid syntax > > > Can you find my mistake, guys ? Sorry to bother you, I try to > find the answer in google, but I can't found the answer. Please help me > soon guys, whatever your answer. If you don't want to answer my question, > please give me some site that could answer this newbie question. Thank's. > > > > > > > > > > > ___ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Is this the right way to create a
-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 services API and return a list of Artists. At a > first guess, it looks like you may want classes for each of the types > listed under "Categories" on the Web Services page. I'm quite new to OOP, so forgive me if I am missing something obvious. When you say that the User class should have a UserProfile as an attribute, would it look something like this? from lastfmapi import UserProfile class User (object): def __init__: self.UserProfile = UserProfile('Bob') Also what do you mean by 'accessors' for Neighbors ? -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) iQEcBAEBCgAGBQJIXqz2AAoJEA759sZQuQ1BKWgIAJMAXzcUkL1MNjXE2xbFXpgf cKAnNfiHpCLp9X8503Fdn8yMA8dq16ktOS7L5EeqsZnU4lpns6XeWzO1RbiUcxY7 i0ojWffBgvtfaK/3b6IteDvL7/+rKKXHiQRzPLDET8XUfoAe9kIXppN49JEfl7s7 JCrEXLv6/eHLcHT+aMCtcKLGF9s85kSW7pipIg61n2H0X3rYl3kZeRE5unjbc2rJ ++YM4CSOrG3n8U3o/NCdnP23p8W2x6WNnndeWG2C7tLa2n/k3QkY2cOpG/tELU+p tpwT9VAeoEvOyKAhtfqfwBS9gCa3hrbnuUt9IDvcHR0TmKJ+rytbLqHOGLtH5rU= =2Ifq -END PGP SIGNATURE- ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] A SAPI Module With Pitch and Create
Hi! I have reduced down and added a few features into the SAPI 5 speech module I have created. You can now save and read wav files. The test module tests most of the features I have in it at the moment. I added the ability inside the Create method to set all the voice parameters. You can change the voice, volume, rate, and pitch in the Create method. They are dict values and just assign the values you want. Pitch and rate are from -10 to 10 with 0 the norm. Where the volume is from 0% to 100% but do not use the (%) symbol, just the integer number. The default for change is 0 for any of the values and the default voice will be the first on the list, which is Sam if you are using the Microsoft SAPI 5 voices. The names are listed in the test. So assignment depends on what you have installed onto your machine. I have not changed any usage of eSpeak voices to allow pitch adjustment yet. An error comes up for those voices because I have not looked into what it wants. This SAPI 5 engine will at least allow you to get started and includes the methods saving and reading a wav file. The wav methods are .SpeakToWav and SpeakFromWav so you could use it for other possible things, such as web sites and games. Enjoy testing it. I have not played with the bookmark method yet. Bruce #DRIVERS FOR SAPI 5 AND VOICES! #NOTE THE CONSTANTS AND IN THE SPEAK FUNCTION AND THE ADDING/OR OF THE VALUES. from comtypes.client import CreateObject import _winreg class constants4tts: Wait = -1 Sync = 0 Async = 1 Purge = 2 Is_filename = 4 XML = 8 Not_XML = 16 Persist = 32 Punc = 64 class SynthDriver(): name="sapi5" description="Microsoft Speech API version 5 (sapi.SPVoice)" _voice = 0 _pitch = 0 _voices = [] _wait = -1 #WAIT INDEFINITELY _sync = 0 #WAIT UNTIL SPEECH IS DONE. _async = 1 #DO NOT WAIT FOR SPEECH _purge = 2 #CLEAR SPEAKING BUFFER _is_filename = 4 #OPEN WAV FILE TO SPEAK OR SAVE TO WAV FILE _xml = 8 #XML COMMANDS, PRONUNCIATION AND GRAMMER. _not_xml = 16 #NO XML COMMANDS _persist_xml = 32 #Changes made in one speak command persist to other calls to Speak. _punc = 64 #PRONOUNCE ALL PUNCTUATION! def check(self): try: r=_winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT,"SAPI.SPVoice") r.Close() return True except: return False #INITIALIZE ENGINE! def init(self): try: self.tts = CreateObject( 'sapi.SPVoice') self._voice=0 self._voiceCount = len(self.tts.GetVoices()) for v in range(self._voiceCount): self._voices.append( self.tts.GetVoices()[v]) return True except: return False #TERMINATE INSTANCE OF ENGINE! def terminate(self): del self.tts #NUMBER OF VOICES FOR ENGINE! def getVoiceCount(self): return len(self.tts.GetVoices()) #NAME OF A VOICE BY NUMBER! def getVoiceNameByNum(self, num): return self.tts.GetVoices()[num-1].GetDescription() #NAME OF A VOICE! def getVoiceName(self): return self.tts.GetVoices()[ self._voice].GetDescription() #WHAT IS VOICE RATE? def getRate(self): "MICROSOFT SAPI 5 RATE IS -10 TO 10" return (self.tts.rate) #WHAT IS THE VOICE PITCH? def getPitch(self): "PITCH FOR MICROSOFT SAPI 5 IS AN XML COMMAND!" return self._pitch #GET THE ENGINE VOLUME! def getVolume(self): "MICROSOFT SAPI 5 VOLUME IS 1% TO 100%" return self.tts.volume #GET THE VOICE NUMBER! def getVoiceNum(self): return self._voice #SET A VOICE BY NAME! def setVoiceByName(self, name): "VOICE IS SET BY NAME!" for i in range( self._voiceCount): if self.tts.GetVoices()[ i].GetDescription().find( name) >= 0: self.tts.Voice = self._voices[i] #self.tts.Speak( "%s Set!" % name) self._voice=i break if i >= self._voiceCount: self.tts.Speak( "%s Not Found!" % name) #USED FOR BOOKMARKING AND USE LATER! def _get_lastIndex(self): bookmark=self.tts.status.LastBookmark if bookmark!="" and bookmark is not None: return int(bookmark) else: return -1 #NOW SET ENGINE PARMS! #SET THE VOICE RATE! def setRate(self, rate): "MICROSOFT SAPI 5 RATE IS -10 TO 10" if rate > 10: rate = 10 if rate < -10: rate = -10 self.tts.Rate = rate #SET PITCH OF THE VOICE! def setPitch(self, value): "MICROSOFT SAPI 5 pitch is really controled with xml around speECH TEXT AND IS -10 TO 10" if value > 10: value = 10 if value < -10: value = -10 self._pitch=value #SET THE VOICE VOLUME! def setVolume(self, value): "MICROSOFT SAPI 5 VOLUME IS 1% TO 100%" self.tts.Volume = value #CREATE ANOTHER INSTANCE OF A VOICE!
Re: [Tutor] Is this the right way to create a
On Sun, Jun 22, 2008 at 3:50 PM, Zameer Manji <[EMAIL PROTECTED]> wrote: > I'm quite new to OOP, so forgive me if I am missing something obvious. > When you say that the User class should have a UserProfile as an > attribute, would it look something like this? > > from lastfmapi import UserProfile > class User (object): >def __init__: >self.UserProfile = UserProfile('Bob') Yes, that's about right. Of course 'Bob' should be an argument passed to __init__() > Also what do you mean by 'accessors' for Neighbors ? class User(object): ... def getNeighbors(): """ Returns a list of this user's neighbors """ and similar for getTopArtists(), etc. Kent > > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.4.7 (MingW32) > > iQEcBAEBCgAGBQJIXqz2AAoJEA759sZQuQ1BKWgIAJMAXzcUkL1MNjXE2xbFXpgf > cKAnNfiHpCLp9X8503Fdn8yMA8dq16ktOS7L5EeqsZnU4lpns6XeWzO1RbiUcxY7 > i0ojWffBgvtfaK/3b6IteDvL7/+rKKXHiQRzPLDET8XUfoAe9kIXppN49JEfl7s7 > JCrEXLv6/eHLcHT+aMCtcKLGF9s85kSW7pipIg61n2H0X3rYl3kZeRE5unjbc2rJ > ++YM4CSOrG3n8U3o/NCdnP23p8W2x6WNnndeWG2C7tLa2n/k3QkY2cOpG/tELU+p > tpwT9VAeoEvOyKAhtfqfwBS9gCa3hrbnuUt9IDvcHR0TmKJ+rytbLqHOGLtH5rU= > =2Ifq > -END PGP SIGNATURE- > ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] dollarize.py
Jordan Greenberg wrote: > def addcommas(s): # assumes type(s)==str > b=[] > l=len(s) > for i,v in enumerate(s): > i+=1 # easier to understand w/ 1-based indexing, i think. > b.append(v) > > if (l-i)%3==0 and not i==l: > b.append(',') > return ''.join(b) > > > or, somewhat more tersely: > > > def addcommas2(s): > l=len(s) > return ''.join(v+',' if (l-(i+1))%3==0 and not i+1-l==0 > else v for i,v in enumerate(s)) Excellent, thanks Jordan! That's much more elegant, and efficient, than my juggling act :) ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] endless processing through for loop
I have a program with 2 for loops like this (in pseudocode): fw = open(newLine.txt, 'w') for i in xrange(0, 700,000, 1): read a file fname from folder for line in open(fname, 'r'): do some simple string processing on line fw.write(newline) fw.close() That's it. Very simple but after i reaches about 550,000 the program begins to crawl. As an example, the loops to 550,000 takes about an hour. From 550,000 to 580,000 takes an additional 4 hours. Any ideas about what could be going on? Dinesh ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] endless processing through for loop
"Dinesh B Vadhia" <[EMAIL PROTECTED]> wrote fw = open(newLine.txt, 'w') for i in xrange(0, 700,000, 1): read a file fname from folder for line in open(fname, 'r'): do some simple string processing on line fw.write(newline) fw.close() From 550,000 to 580,000 takes an additional 4 hours. Sounds like a memory problem,. Can you look in Task manager (assuming Windows) or top(Linux) to see what the memory usage looks like? In theory the read files should get closed automatically but being extra cautious I might try the inner loop as: fr = open(fname, 'r') for line in fr: do some simple string processing on line fw.write(newline) fr.close() Just to be sure. I might also try adding an fw.flush() after the write to ensure it goes to disk. If that isn't enough I might try opening and closing the write file each time using append mode. In theiry that shouldn't make any difference but it might be that its trying to hold the entire output file (which must be huge!) in memory... Not certain any of those will help but its something to try! Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] endless processing through for loop
On Sun, Jun 22, 2008 at 8:13 PM, Dinesh B Vadhia <[EMAIL PROTECTED]> wrote: > That's it. Very simple but after i reaches about 550,000 the program begins > to crawl. As an example, the loops to 550,000 takes about an hour. From > 550,000 to 580,000 takes an additional 4 hours. > > Any ideas about what could be going on? What happens to memory use? Does it start to thrash the disk? Are you somehow keeping the file contents in memory for all the files you read? Kent ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] endless processing through for loop
There is no thrashing of disk as I have > 2gb RAM and I'm not keeping the file contents in memory. One line is read at a time, some simple string processing and then writing out the modified line. From: Kent Johnson Sent: Sunday, June 22, 2008 5:39 PM To: Dinesh B Vadhia Cc: tutor@python.org Subject: Re: [Tutor] endless processing through for loop On Sun, Jun 22, 2008 at 8:13 PM, Dinesh B Vadhia <[EMAIL PROTECTED]> wrote: > That's it. Very simple but after i reaches about 550,000 the program begins > to crawl. As an example, the loops to 550,000 takes about an hour. From > 550,000 to 580,000 takes an additional 4 hours. > > Any ideas about what could be going on? What happens to memory use? Does it start to thrash the disk? Are you somehow keeping the file contents in memory for all the files you read? Kent ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] endless processing through for loop
On 23/06/2008, Dinesh B Vadhia <[EMAIL PROTECTED]> wrote: > I have a program with 2 for loops like this (in pseudocode): > > fw = open(newLine.txt, 'w') > for i in xrange(0, 700,000, 1): > read a file fname from folder > for line in open(fname, 'r'): > do some simple string processing on line > fw.write(newline) > fw.close() > > That's it. Very simple but after i reaches about 550,000 the program begins > to crawl. As an example, the loops to 550,000 takes about an hour. From > 550,000 to 580,000 takes an additional 4 hours. > > Any ideas about what could be going on? What happens if you reverse the loop? i.e. change to: for i in xrange(69, -1, -1): -- John. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] references to containing objects
I am looking for a way to tell a object the properties of its containing object. For example, I have an object foo, of class Bar, which I have stored in a dict in the object I want to access. Basically: container_object.contained_object["foo"].action() What I want is for the object "foo" to be able to access properties of container_object through its action() method. the problem is that I don't know what the containing object's name is going to be before hand, so I can't just access it through the object's name. I'm thinking I could create a dict of the container_objects, so when the object was created the name could be passed to the action() method, but is there another way to do it? Thanks in advance. John ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor