Re: type = "instance" instead of "dict"

2006-02-28 Thread Cruella DeVille
This is off topic, but if read the documentation is the answere to everything why do we need news groups? The problem with the documentation for Python is that I can't find what I'm looking for (and I didn't even know what I was looking for either). And since every language is well documented... th

Re: Catch exceptions

2006-02-27 Thread Cruella DeVille
I put the try catch in my main-method, and it worked to some extent (except from when I try to read from a file with no content) Any idea how to solve that? And is it a good place to have a try-except in main instead of in the class methods? My code is at http://nibbler.no/blog/wp-includes/Bookma

Catch exceptions

2006-02-27 Thread Cruella DeVille
In my application of bookmarks I get a filename as a parameter in one of my methods. I want to catch the "FileNotFoundException" if the user types an invalid filename. My code (that doesn't do what I want it to do - namely print a nicely formatted error message, and no stack trace) def openFile(se

Re: type = "instance" instead of "dict"

2006-02-27 Thread Cruella DeVille
I created a class Dict (not dict), but since it only complicates things for me I implemented my program without it. when I wrote myDictionary = dictionary.__dict__.iteritems() it worked better... what does the __dict__ mean? -- http://mail.python.org/mailman/listinfo/python-list

Re: type = "instance" instead of "dict"

2006-02-27 Thread Cruella DeVille
So what you are saying is that my class Dict is a subclass of Dict, and user defined dicts does not support iteration? What I'm doing is that I want to write the content of a dictionary to a file, and send the dictionary (favDict) as a parameter like this: favDict = Dict() <-- my own class (or not

type = "instance" instead of "dict"

2006-02-27 Thread Cruella DeVille
I'm trying to implement a bookmark-url program, which accepts user input and puts the strings in a dictionary. Somehow I'm not able to iterate myDictionary of type Dict{} When I write print type(myDictionary) I get that the type is "instance", which makes no sense to me. What does that mean? Thank