ANN: twill-0.8.1, Web browsing language

2005-12-11 Thread C. Titus Brown
ANNOUNCING twill v0.8.1. twill is a simple language for browsing the Web. It's designed for automated testing of Web sites, but it can be used to interact with Web sites in a variety of ways. In particular, twill supports form submission, cookies, redirects, and HTTP authentication. A twill

ANN: WCK for Tkinter 1.1 final (december 11, 2005)

2005-12-11 Thread Fredrik Lundh
The Widget Construction Kit (WCK) is an extension API that allows you to implement custom widgets in pure Python. The WCK can be (and is being) used for everything from light-weight display widgets to full-blown editor frameworks. The Tkinter3000 implementation of the WCK supports all recent

Re: newbie question

2005-12-11 Thread Bermi
Dody Suria thank u. -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-11 Thread Zeljko Vrba
On 2005-12-11, Rick Wotnaz [EMAIL PROTECTED] wrote: Make a grocery list. Do you terminate each item with punctuation? Write a headline for a newspaper. Is actually, I do. i write as much as fits in one line and separate items with comma. may find Python's set strange at first. Please try

Re: Using XML w/ Python...

2005-12-11 Thread Jay
Yes i know, i did check out a couple but i could never understand it. They were confusing for me and i wasnt hoping for a full typed tutorial, just like some help with excactly wat im trying to do, not the whole module... but watever, Thx alot for the feedbak. --

Re: Proposal: Inline Import

2005-12-11 Thread Bengt Richter
On Sat, 10 Dec 2005 19:40:08 -0800, Robert Kern [EMAIL PROTECTED] wrote: Bengt Richter wrote: Are you willing to type a one-letter prefix to your .re ? E.g., class I(object): ... def __getattr__(self, attr): ... return __import__(attr) [snip] There are special caveats re

Re: Proposal: Inline Import

2005-12-11 Thread bonono
Shane Hathaway wrote: Mike Meyer wrote: Shane Hathaway [EMAIL PROTECTED] writes: I'd like a way to import modules at the point where I need the functionality, rather than remember to import ahead of time. This might eliminate a step in my coding process. Currently, my process is I change

Re: OO in Python? ^^

2005-12-11 Thread Matthias Kaeppler
Heiko Wundram wrote: Brian Beck wrote: class D1(Base): def foo(self): print D1 class D2(Base): def foo(self): print D2 obj = Base() # I want a base class reference which is polymorphic if (need D1): obj = D1() else: obj = D2() I have no idea what you're trying to do

Re: OO in Python? ^^

2005-12-11 Thread Matthias Kaeppler
Brian Beck wrote: def foo(self): raise NotImplementedError(Subclasses must implement foo) That's actually a good idea, though not as nice as a check at compile-time (jesus, I'm probably talking in C++ speech again, is there such a thing as compile-time in Python at all?!) Another thing

Re: OO in Python? ^^

2005-12-11 Thread Matthias Kaeppler
That was quite insightful Martin, thanks. Regards, Matthias -- http://mail.python.org/mailman/listinfo/python-list

Re: OO in Python? ^^

2005-12-11 Thread Torsten Bronger
Hallöchen! Matthias Kaeppler [EMAIL PROTECTED] writes: [...] Another thing which is really bugging me about this whole dynamically typing thing is that it seems very error prone to me: foo = some string! # ... if (something_fubar): fo = another string Oops, the last 'o' slipped,

Re: Proposal: Inline Import

2005-12-11 Thread Martin v. Löwis
Shane Hathaway wrote: Do you have any ideas on how to improve the process of maintaining imports? Benji's suggestion of jumping around doesn't work for moving code and it interrupts my train of thought. Sprinkling the code with import statements causes a speed penalty and a lot of clutter.

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-11 Thread Steve Holden
Zeljko Vrba wrote: On 2005-12-11, Rick Wotnaz [EMAIL PROTECTED] wrote: Make a grocery list. Do you terminate each item with punctuation? Write a headline for a newspaper. Is actually, I do. i write as much as fits in one line and separate items with comma. may find Python's set

Re: Another newbie question

2005-12-11 Thread Steve Holden
Paul Rubin wrote: Steven D'Aprano [EMAIL PROTECTED] writes: The fact that sys is a module and not a class is a red herring. If the Law of Demeter makes sense for classes, it makes just as much sense for modules as well -- it is about reducing coupling between pieces of code, not something

wxpython book

2005-12-11 Thread [EMAIL PROTECTED]
I have seen some brief mention of the new book by Robin Dunn in one or two posts. But none that highlight that the book is to be published sometime at then end of Jan 2006. I hope that turns out to be an accurate date. It has been long-awaited so I thought it ought to get a proper mention. I

Re: Proposal: Inline Import

2005-12-11 Thread Martin v. Löwis
Shane Hathaway wrote: Thoughts? I have two reasons to dislike it: 1. It's a language change. Others have pointed out that you can achieve the same without a language change; it would be easy to write name_expr = _import.re.compile('[a-zA-Z]+') 2. In the form in which you have written it,

Re: slice notation as values?

2005-12-11 Thread Duncan Booth
Brian Beck wrote: Antoon Pardon wrote: Will it ever be possible to write things like: a = 4:9 I made a silly recipe to do something like this a while ago, not that I'd recommend using it. But I also think it wouldn't be too far-fetched to allow slice creation using a syntax like the

Re: Using XML w/ Python...

2005-12-11 Thread Ivan Herman
Look at the standard python library reference http://docs.python.org/lib/dom-example.html the handleSlide function almost does what you want, except that you should use 'parse' and not 'parseString'. Original Message From: Jay [EMAIL PROTECTED] To: Subject: Re:Using XML w/

Re: double underscore attributes?

2005-12-11 Thread Steve Holden
[EMAIL PROTECTED] wrote: Entering dir(5) I get ['__abs__', '__add__', '__and__', '__class__', '__cmp__', '__coerce__', '__delattr__', '__div__', '__divmod__', '__doc__', '__float__', '__floordiv__', '__getattribute__', '__getnewargs__', '__hash__', '__hex__', '__init__', '__int__',

Re: Using XML w/ Python...

2005-12-11 Thread Steve Holden
Jay wrote: Yes i know, i did check out a couple but i could never understand it. They were confusing for me and i wasnt hoping for a full typed tutorial, just like some help with excactly wat im trying to do, not the whole module... but watever, Thx alot for the feedbak. Well I don't want to

Re: Using XML w/ Python...

2005-12-11 Thread Dieter Verfaillie
On Sat, 10 Dec 2005 21:12:04 -0800, Jay wrote: OK, I have this XML doc, i dont know much about XML, but what i want to do is take certain parts of the XML doc the most simple module I've found to do that is xmltramp from http://www.aaronsw.com/2002/xmltramp/ for example: #!/usr/bin/env

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-11 Thread Zeljko Vrba
On 2005-12-11, Steve Holden [EMAIL PROTECTED] wrote: I don't suppose there's any good reason, then, why (for example) outlining tools use indentation to indicate different levels of significance. Nobody bothers to figure out something better? Now you will argue that then the indendation is

Re: OO in Python? ^^

2005-12-11 Thread Ernst Noch
Matthias Kaeppler wrote: Brian Beck wrote: def foo(self): raise NotImplementedError(Subclasses must implement foo) That's actually a good idea, though not as nice as a check at compile-time (jesus, I'm probably talking in C++ speech again, is there such a thing as compile-time in

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-11 Thread bonono
Zeljko Vrba wrote: I'm sorry you find the indentation unnatural and inconvenient, but you may have to accept that for this feature you are actually in a minority. I have no problem accepting that I'm in a minority. I have a problem with offensive people using my example arguments to

Re: OO in Python? ^^

2005-12-11 Thread gene tani
Matthias Kaeppler wrote: That was quite insightful Martin, thanks. Regards, Matthias (Disclaimer: i didn't read thru whole thread, but i didn't see these links trotted out either, which're germane: http://naeblis.cx/rtomayko/2004/12/15/the-static-method-thing

Re: OO in Python? ^^

2005-12-11 Thread Steven D'Aprano
On Sun, 11 Dec 2005 10:02:31 +0100, Matthias Kaeppler wrote: Brian Beck wrote: def foo(self): raise NotImplementedError(Subclasses must implement foo) That's actually a good idea, though not as nice as a check at compile-time (jesus, I'm probably talking in C++ speech again, is

Re: OO in Python? ^^

2005-12-11 Thread bonono
Steven D'Aprano wrote: Python works well with test-driven development. Test-driven development will pick up this sort of error, and many other errors too, with less effort and more certainty than compile-time checking. The problem with static typed languages is that they make the programmer

Great books on Python?

2005-12-11 Thread Tolga
I am not unfamiliar to programming but a newbie in Python. Could you recommend me (a) great book(s) to start with? Free online books or solid books are welcome. Thanx in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: OO in Python? ^^

2005-12-11 Thread Chris Mellon
On 12/11/05, Matthias Kaeppler [EMAIL PROTECTED] wrote: Brian Beck wrote: def foo(self): raise NotImplementedError(Subclasses must implement foo) That's actually a good idea, though not as nice as a check at compile-time (jesus, I'm probably talking in C++ speech again, is there such

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-11 Thread Zeljko Vrba
On 2005-12-11, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Welcome to c.l.py Oh, thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: OO in Python? ^^

2005-12-11 Thread Fredrik Lundh
Matthias Kaeppler wrote: I really see issues with this, can anyone comment on this who has been working with Python more than just a day (like me)? Maybe you should work with Python more than one day before you start looking for potential problems? ;-) (I suggest reimplementing some portion

Re: OO in Python? ^^

2005-12-11 Thread Aahz
In article [EMAIL PROTECTED], Matthias Kaeppler matthias at finitestate dot org wrote: Another thing which is really bugging me about this whole dynamically typing thing is that it seems very error prone to me: foo = some string! # ... if (something_fubar): fo = another string Oops, the

Using XML w/ Python...

2005-12-11 Thread Michael Williams
If you just want to get into it and use it, I'd recommend the following: http://uche.ogbuji.net/uche.ogbuji.net/tech/4suite/amara/It requires the installation of the 4Suite module as well, but it's well worth it.  I uses data binding techniques to convert your document into a large tree of named

Re: OO in Python? ^^

2005-12-11 Thread Steven D'Aprano
On Sun, 11 Dec 2005 05:48:00 -0800, bonono wrote: Steven D'Aprano wrote: Python works well with test-driven development. Test-driven development will pick up this sort of error, and many other errors too, with less effort and more certainty than compile-time checking. The problem with

Re: OO in Python? ^^

2005-12-11 Thread bonono
Steven D'Aprano wrote: And I don't think Haskell make the programmer do a lot of work(just because of its static type checking at compile time). I could be wrong, but I think Haskell is *strongly* typed (just like Python), not *statically* typed. At least the What Is Haskell? page at

instance + classmethod question

2005-12-11 Thread Laszlo Zsolt Nagy
Hello, Is it possible to tell, which instance was used to call the classmethod that is currently running? Background: I have a class called DatabaseConnection and it has a classmethod called process_create_tables. This method should create some database tables defined by a database

Re: subset permutations

2005-12-11 Thread Anton Vredegoor
Steven D'Aprano wrote: On Fri, 09 Dec 2005 16:03:46 +1100, Ben Finney wrote: Do you want the result to be: AB, AC, AD, BC, BD, CD That is the complete set of combinations of the letters. Or, do you want AB,BA,AC,CA,AD,DA,BC,CB,BD,DB,CD,DB ? That is the complete set of

Re: OO in Python? ^^

2005-12-11 Thread D H
Fredrik Lundh wrote: Write code, not usenet posts. QOTW! -- http://mail.python.org/mailman/listinfo/python-list

Re: Great books on Python?

2005-12-11 Thread Xavier Morel
Tolga wrote: I am not unfamiliar to programming but a newbie in Python. Could you recommend me (a) great book(s) to start with? Free online books or solid books are welcome. Thanx in advance. I'd call Dive Into Python a reference, it's an extremely clear yet pythonic book, and it's

Re: Great books on Python?

2005-12-11 Thread BartlebyScrivener
http://www.awaretek.com/tutorials.html#regular -- http://mail.python.org/mailman/listinfo/python-list

Re: Great books on Python?

2005-12-11 Thread D H
Tolga wrote: I am not unfamiliar to programming but a newbie in Python. Could you recommend me (a) great book(s) to start with? Free online books or solid books are welcome. http://www.ibiblio.org/g2swap/byteofpython/read/index.html http://www.ibiblio.org/obp/thinkCSpy/

Re: OO in Python? ^^

2005-12-11 Thread bonono
Ernst Noch wrote: Matthias Kaeppler wrote: Brian Beck wrote: def foo(self): raise NotImplementedError(Subclasses must implement foo) That's actually a good idea, though not as nice as a check at compile-time (jesus, I'm probably talking in C++ speech again, is there such a

Re: Another newbie question

2005-12-11 Thread Alex Martelli
Mike Meyer [EMAIL PROTECTED] wrote: ... It's not my cherished example - it actually came from someone You picked it to (try and fail to) show that there is DIFFICULTY, which I showed there isn't. else. That you can change the requirements so that there is no extra work is immaterial - all

Re: OO in Python? ^^

2005-12-11 Thread Matthias Kaeppler
gene tani wrote: http://naeblis.cx/rtomayko/2004/12/15/the-static-method-thing http://dirtsimple.org/2004/12/java-is-not-python-either.html http://dirtsimple.org/2004/12/python-is-not-java.html http://idevnews.com/PrintVersion_CaseStudies.asp?Search3=web+servicesGo2=GoID=118

Re: OO in Python? ^^

2005-12-11 Thread Matthias Kaeppler
[EMAIL PROTECTED] wrote: Just follow the links. I'll try ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: instance + classmethod question

2005-12-11 Thread Steven Bethard
Laszlo Zsolt Nagy wrote: Hello, Is it possible to tell, which instance was used to call the classmethod that is currently running? [snip] processor = SQLProcessors.StdOutProcessor() # Print to stdout PostgreSQLConnection.process_create_tables(processor,dbdef) # This sould create

Re: Another newbie question

2005-12-11 Thread Alex Martelli
Mike Meyer [EMAIL PROTECTED] wrote: ... Claim: doing X makes Y hard. Harder, not hard. The specific wording you used was MORE DIFFICULT. Here is an example of doing X where Y is easy Y is very easy in any case. Making it incrementally harder doesn't make it hard - it's still very

Re: OO in Python? ^^

2005-12-11 Thread Steven D'Aprano
On Sun, 11 Dec 2005 07:10:27 -0800, bonono wrote: Steven D'Aprano wrote: And I don't think Haskell make the programmer do a lot of work(just because of its static type checking at compile time). I could be wrong, but I think Haskell is *strongly* typed (just like Python), not

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-11 Thread Fredrik Lundh
Zeljko Vrba wrote: Nobody bothers to figure out something better? Now you will argue that then the indendation is good enough.. and I can just reply that then it's an open research question.. huh? people mention existing research (including formal usability studies), and your response is

Re: OO in Python? ^^

2005-12-11 Thread Paul Boddie
Heiko Wundram wrote: Maybe I'm assuming things by thinking that others also follow my line of thought, but I've actually had very positive responses so far when telling people that a certain feature is a certain way and then pointing them to the ZoP, they all pretty much told me after a

Re: OO in Python? ^^

2005-12-11 Thread bonono
Steven D'Aprano wrote: On Sun, 11 Dec 2005 07:10:27 -0800, bonono wrote: Steven D'Aprano wrote: And I don't think Haskell make the programmer do a lot of work(just because of its static type checking at compile time). I could be wrong, but I think Haskell is *strongly* typed (just

Re: OO in Python? ^^

2005-12-11 Thread Paul Boddie
Steven D'Aprano wrote: Weakly typed languages do not prevent you performing operations on mismatched types, e.g. something like 1 + 1 is allowed in languages like Basic and Perl. Actually, Perl and at least the version of BASIC that I previously used are not weakly-typed languages either. The

Re: Great books on Python?

2005-12-11 Thread Nate Bargmann
On Sun, 11 Dec 2005 06:15:17 -0800, Tolga wrote: I am not unfamiliar to programming but a newbie in Python. Could you recommend me (a) great book(s) to start with? Free online books or solid books are welcome. Thanx in advance. O'Reilly's Learning Python Second Edition covers up to

Re: instance + classmethod question

2005-12-11 Thread Laszlo Zsolt Nagy
Hello Steven, I already implemented this using the form @classmethod def methodname(cls,other_params,self=None) but your example code looks so neat! This is exactly what I needed. :-) In my methods, most code is about string manipulation and calling other classmethods. There are only a few

Re: XML and namespaces

2005-12-11 Thread Paul Boddie
Alan Kennedy wrote: [Discussing the appearance of xmlns=DAV:] But that's incorrect. You have now defaulted the namespace to DAV: for every unprefixed element that is a descendant of the href element. [Code creating the no_ns element with namespaceURI set to None] ?xml version=1.0? href

Re: OO in Python? ^^

2005-12-11 Thread Steven D'Aprano
On Sun, 11 Dec 2005 17:05:16 +0100, Matthias Kaeppler wrote: Why would I want to use an attribute in Python, where I would use getters and setters in Java? Oh boy! I've just come out of a rather long thread about that very issue. If you care enough to read a bunch of people arguing past each

Re: OO in Python? ^^

2005-12-11 Thread Aahz
In article [EMAIL PROTECTED], Matthias Kaeppler matthias at finitestate dot org wrote: Why would I want to use an attribute in Python, where I would use getters and setters in Java? I know that encapsulation is actually just a hack in Python (common, hiding an implementation detail by

Random Number Generation?

2005-12-11 Thread Dimos
Hello All, I need some help with random number generation. What I need exactly is: To create a few thousand numbers, decimal and integers, between 5 and 90, and then to export them as a single column at a spreadsheet. I am newbie, I was not able to create decimals with the random modules of

Re: OO in Python? ^^

2005-12-11 Thread Alex Martelli
Matthias Kaeppler [EMAIL PROTECTED] wrote: ... I stumbled over this paragraph in Python is not Java, can anyone elaborate on it: In Java, you have to use getters and setters because using public fields gives you no opportunity to go back and change your mind later to using getters and

Re: OO in Python? ^^

2005-12-11 Thread Alex Martelli
Matthias Kaeppler [EMAIL PROTECTED] wrote: ... I'm so used to statically typed languages that the shift is very confusing. Looks as if it isn't as easy to learn Python afterall, for the mere reason of unlearning rules which don't apply in the world of Python anymore (which seem to be quite

Re: binascii.crc32 results not matching

2005-12-11 Thread Larry Bates
Thanks so much for the offer, I had a friend do this for me and it works great. Regards, Larry Bates Heiko Wundram wrote: Larry Bates wrote: snip lots of code The algorithm looks very much like the source code for binascii.crc32 (but I'm not a C programmer). Well... As you have access

Re: OO in Python? ^^

2005-12-11 Thread Alex Martelli
Steven D'Aprano [EMAIL PROTECTED] wrote: On Sun, 11 Dec 2005 17:05:16 +0100, Matthias Kaeppler wrote: Why would I want to use an attribute in Python, where I would use getters and setters in Java? Oh boy! I've just come out of a rather long thread about that very issue. If you care

Re: Random Number Generation?

2005-12-11 Thread Alex Martelli
Dimos [EMAIL PROTECTED] wrote: Hello All, I need some help with random number generation. What I need exactly is: To create a few thousand numbers, decimal and integers, between 5 and 90, and then to export them as a single column at a spreadsheet. I am newbie, I was not able to

Re: OO in Python? ^^

2005-12-11 Thread Xavier Morel
Matthias Kaeppler wrote: Why would I want to use an attribute in Python, where I would use getters and setters in Java? I know that encapsulation is actually just a hack in Python (common, hiding an implementation detail by prefixing it with the classname so you can't access it by its name

Re: OO in Python? ^^

2005-12-11 Thread Paul Boddie
Steven D'Aprano wrote: I look at it this way: as the class designer, I have ZERO idea what attributes and methods of my class will be just the perfect thing to solve somebody's problem, so it is rude of me to lock them up as private -- especially since they *will* find a way to hack my class

Re: Random Number Generation?

2005-12-11 Thread Fredrik Lundh
Dimos wrote: I need some help with random number generation. What I need exactly is: To create a few thousand numbers, decimal and integers, between 5 and 90, and then to export them as a single column at a spreadsheet. I am newbie, I was not able to create decimals with the random

Re: Random Number Generation?

2005-12-11 Thread [EMAIL PROTECTED]
Dimos wrote: Hello All, I need some help with random number generation. What I need exactly is: To create a few thousand numbers, decimal and integers, between 5 and 90, and then to export them as a single column at a spreadsheet. I am newbie, I was not able to create decimals with

Re: binascii.crc32 results not matching

2005-12-11 Thread Fredrik Lundh
I wrote: this prints 0xF032519BL 0xF032519BL 0x90E3070AL 0x90E3070AL no time to sort out the int/long mess for binascii.crc32, but it pro- bably needs the same tweaking as PIL (which handles the CRC as two 16-bit numbers, to avoid sign hell). I realized that I used 2.3 for testing.

information needed to make a connection between computers

2005-12-11 Thread John Walton
Hello again! I'm still working on that instant messenger (for science fair), and I have been reading about networking in some Java tutorials. In one part of it, it said to have a connection with another computer, you need to know the IP name of the computer you want to connect with. I don't

Re: Managing import statements

2005-12-11 Thread Giovanni Bajo
Shane Hathaway wrote: Here's the real problem: maintaining import statements when moving sizable blocks of code between modules is hairy and error prone. You can also evaluate a solution like this: http://codespeak.net/py/current/doc/misc.html#the-py-std-hook -- Giovanni Bajo --

Re: information needed to make a connection between computers

2005-12-11 Thread Tim Williams (gmail)
On 11/12/05, John Walton [EMAIL PROTECTED] wrote: Hello again! I'm still working on that instant messenger (for science fair), and I have been reading about networking in some Java tutorials. In one part of it, it said to have a connection with another computer, you need to know the IP name of the

Re: python and VisualFox dbf

2005-12-11 Thread Thomas Ganss
lux schrieb: Hi, I've a dfb written in VisualFox, I need to send a pack and reindex but in odbc is not supported... Anybody know how to do this? TIA, Luca I am quite sure this is supported in OLEDB. I thought this was also supported via ODBC, but you have to make sure that you are

Re: ANN: pygene0.12 - Genetic ProgrammingAlgorithms Library

2005-12-11 Thread eXt
aum wrote: Hi all, This announcement supersedes an earlier announcement of pygene. pygene 0.2 now supports genetic programming, in addition to the classical Mendelian genetic algorithms of the earlier version. I thank the respondents to the earlier announcement for inspiring me to

Re: Great books on Python?

2005-12-11 Thread David Van Mosselbeen
Tolga wrote: I am not unfamiliar to programming but a newbie in Python. Could you recommend me (a) great book(s) to start with? Free online books or solid books are welcome. Thanx in advance. Some days ago there was an similar subject 'Learning Python', wish give you some usefull

Re: XML and namespaces

2005-12-11 Thread Alan Kennedy
[Paul Boddie] However, wouldn't the correct serialisation of the document be as follows? ?xml version=1.0? href xmlns=DAV:no_ns xmlns=//href Yes, the correct way to override a default namespace is an xmlns= attribute. [Paul Boddie] As for the first issue - the presence of the xmlns

mail attachment with non-ascii name

2005-12-11 Thread Bernard Delmée
I am using the email module to decode incoming messages. (with msg = email.message_from_file( msg_file )) Sometimes an attachment has its name (as returned by msg.walk().part.get_filename()) not in ASCII (e.g. '=?iso-8859-1?q?somefile=2ezip?=') How can I turn that into simply 'somefile.zip' ? I

Re: OO in Python? ^^

2005-12-11 Thread Bruno Desthuilliers
Matthias Kaeppler a écrit : Hi, sorry for my ignorance, but after reading the Python tutorial on python.org, I'm sort of, well surprised about the lack of OOP capabilities in python. I beg your pardon ??? Honestly, I don't even see the point at all of how OO actually works in Python.

Re: Creating referenceable objects from XML

2005-12-11 Thread uche . ogbuji
Michael Williams wrote: Hi All, I'm looking for a quality Python XML implementation. All of the DOM and SAX implementations I've come across so far are rather convoluted. Are there any quality implementations that will (after parsing the XML) return an object that is accessible by name?

Re: Using XML w/ Python...

2005-12-11 Thread uche . ogbuji
Jay: K, I have this XML doc, i dont know much about XML, but what i want to do is take certain parts of the XML doc, such as /title blah /title and take just that and put onto a text doc. Then same thing doe the /body part. Thats about it, i checked out some of the xml modules but dont

Re: OO in Python? ^^

2005-12-11 Thread Alex Martelli
Paul Boddie [EMAIL PROTECTED] wrote: ... offer some kind of solution to that problem. Moreover, Python also lets you define double-underscore attribute names which behave give instance attributes privacy in all respects, being invisible to users of the instances concerned, accessible only

Re: OO in Python? ^^

2005-12-11 Thread Bruno Desthuilliers
Matthias Kaeppler a écrit : (snip) I stumbled over this paragraph in Python is not Java, can anyone elaborate on it: In Java, you have to use getters and setters because using public fields gives you no opportunity to go back and change your mind later to using getters and setters. So

Re: Creating referenceable objects from XML

2005-12-11 Thread Alan Kennedy
[Michael Williams] I need it to somehow convert my XML to intuitively referenceable object. Any ideas? I could even do it myself if I knew the mechanism by which python classes do this (create variables on the fly). You seem to already have a fair idea what kind of model you need, and to

Re: instance + classmethod question

2005-12-11 Thread Steven Bethard
Laszlo Zsolt Nagy wrote: In my methods, most code is about string manipulation and calling other classmethods. There are only a few places where I can use an instance, but it is not required. I would like to reuse as most code as possible, so I do not want to create two different

Displaying error message in a try except?

2005-12-11 Thread wawork
Fairly new to python. In a try except how do you display the true (raw) error message so it can be displayed back to the user? -- http://mail.python.org/mailman/listinfo/python-list

Re: mail attachment with non-ascii name

2005-12-11 Thread Neil Hodgson
Bernard Delmée: I am using the email module to decode incoming messages. (with msg = email.message_from_file( msg_file )) Sometimes an attachment has its name (as returned by msg.walk().part.get_filename()) not in ASCII (e.g. '=?iso-8859-1?q?somefile=2ezip?=') How can I turn that into

Re: Displaying error message in a try except?

2005-12-11 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: Fairly new to python. In a try except how do you display the true (raw) error message so it can be displayed back to the user? assuming that true means the message you would get if you hadn't used a try/except, the traceback module is what you want: import

Re: OO in Python? ^^

2005-12-11 Thread Mike Meyer
Paul Boddie [EMAIL PROTECTED] writes: One classic example of a weakly-typed language is BCPL, apparently, but hardly anyone has any familiarity with it any more. Actually, BCPL is what Stevenn D'Aprano called untyped. Except his definition is suitable for after everyone followed IBM's

Re: XML and namespaces

2005-12-11 Thread Paul Boddie
Alan Kennedy wrote: Serialisation and namespace normalisation are both in the realm of DOM Level 3, whereas minidom is only L2 compliant. Automagically introducing L3 semantics into the L2 implementation is the wrong thing to do. I think I'll have to either add some configuration support, in

Re: Using XML w/ Python...

2005-12-11 Thread Jay
some great suggestions. Ok, i am now understanding some of parseing and how to use it and nodes, things like that. But say i wanted to take the title of http://www.digg.com/rss/index.xml and XMLTramp seemed the most simple to understand. would the path be something like this? import xmltramp

Re: OO in Python? ^^

2005-12-11 Thread Mike Meyer
Steven D'Aprano [EMAIL PROTECTED] writes: Of course, the IT world is full of people writing code and not testing it, or at least not testing it correctly. That's why there are frequent updates or upgrades to software that break features that worked in the older version. That would be

Re: OO in Python? ^^

2005-12-11 Thread Mike Meyer
Bruno Desthuilliers [EMAIL PROTECTED] writes: ^^ There is no functionality to check if a subclass correctly implements an inherited interface I don't know of any language that provide such a thing. At least for my definition of correctly. Well, since your definition of correclty is uknown,

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-11 Thread Mike Meyer
Zeljko Vrba [EMAIL PROTECTED] writes: An obvious defficieny of the current way we write code now is its inherent tree-structure resulting from {}, indentation, begin/end markers or whatnot. But the flow of code is often not a tree but a cycle.. Yet we are always dealing with a tree-like

Re: Displaying error message in a try except?

2005-12-11 Thread Tim Williams (gmail)
On 11/12/05, Fredrik Lundh [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Fairly new to python.In a try except how do you display the true (raw) error message so it can be displayed back to the user? assuming that true means the message you would get if you hadn'tused a try/except, the

Re: Another newbie question

2005-12-11 Thread Mike Meyer
[EMAIL PROTECTED] (Alex Martelli) writes: Mike Meyer [EMAIL PROTECTED] wrote: ... It's not my cherished example - it actually came from someone You picked it to (try and fail to) show that there is DIFFICULTY, which I showed there isn't. No, you showed you could change the example so

Re: instance + classmethod question

2005-12-11 Thread Mike Meyer
Laszlo Zsolt Nagy [EMAIL PROTECTED] writes: Is it possible to tell, which instance was used to call the classmethod that is currently running? Ok, I read through what got to my nntp server, and I'm still completely confused. A class method isn't necessarilry called by an instance. That's why

Pythonic XML library with XPath support for Jython?

2005-12-11 Thread James
A couple of years ago there wasn't one and the recommendation was to simply use Java libs. Have things changed since? I see ElementTree promises one in the future but are there any out now? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-11 Thread Tom Anderson
On Sun, 11 Dec 2005, Steven D'Aprano wrote: On Sat, 10 Dec 2005 16:34:13 +, Tom Anderson wrote: On Sat, 10 Dec 2005, Sybren Stuvel wrote: Zeljko Vrba enlightened us with: Find me an editor which has folds like in VIM, regexp search/replace within two keystrokes (ESC,:), marks to

Re: Using XML w/ Python...

2005-12-11 Thread uche . ogbuji
Ok, i am now understanding some of parseing and how to use it and nodes, things like that. But say i wanted to take the title of http://www.digg.com/rss/index.xml and XMLTramp seemed the most simple to understand. would the path be something like this? import xmltramp rssDigg =

Re: Another newbie question

2005-12-11 Thread Alex Martelli
Mike Meyer [EMAIL PROTECTED] wrote: ... Except you haven't shown that the API was badly designed. You can't show that it's badly designed, because you don't know the requirements that the API is meeting. I can show that an API is badly designed *whatever requirements it might be intended

Re: OO in Python? ^^

2005-12-11 Thread Tom Anderson
On Mon, 12 Dec 2005, Steven D'Aprano wrote: On Sun, 11 Dec 2005 05:48:00 -0800, bonono wrote: And I don't think Haskell make the programmer do a lot of work(just because of its static type checking at compile time). I could be wrong, but I think Haskell is *strongly* typed (just like

  1   2   >