Problem with Lexical Scope

2005-12-11 Thread [EMAIL PROTECTED]
I am not completely knowledgable about the status of lexical scoping in Python, but it was my understanding that this was added in a long time ago around python2.1-python2.2 I am using python2.4 and the following code throws a "status variable" not found in the inner-most function, even when I try

Re: newbie question

2005-12-11 Thread Tim Roberts
"Bermi" <[EMAIL PROTECTED]> wrote: >i have this program >=== >from sys import * >import math >import math, Numeric >from code import * >from string import * >from math import * >from dataSet import * >from string import * I know you said you are a newbie. That means there is stil

Re: lambda (and reduce) are valuable

2005-12-11 Thread Steven Bethard
Paul Rubin wrote: > Chris Mellon <[EMAIL PROTECTED]> writes: > >>As someone who does a tremendous amount of event-driven GUI >>programming, I'd like to take a moment to speak out against people >>using us as a testament to the virtues of lamda. Event handlers are >>the most important part of event

Re: puzzled about class attribute resolution and mangling

2005-12-11 Thread Brian van den Broek
James Stroud said unto the world upon 2005-12-09 20:39: > Brian van den Broek wrote: > >>Hi all, >> >>I've the following code snippet that puzzles me: >> >>class Base(object): >>__v, u = "Base v", "Base u" >>def __init__(self): >>print self.__v, self.u >> >>class Derived(Base): >>

Re: Using XML w/ Python...

2005-12-11 Thread uche . ogbuji
""" Spoke too soon, i get this error when running amara in ActivePython >>> import amara >>> amara.parse("http://www.digg.com/rss/index.xml";) Traceback (most recent call last): File "", line 1, in ? File "C:\Python23\Lib\site-packages\amara\__init__.py", line 50, in parse if IsXml(source

Re: nanothreads: Want to use them from within wxPython app

2005-12-11 Thread simonwittber
F. GEIGER wrote: > I've def'ed a handler for EVT_IDLE in the app's main frame. There I'd like > to call the nanothreads' __iter__ method, somehow. > > When I copy the __iter__ method into a, say, runOnce() method and call the > next() method of the generator returned by runOnce(), it works. But I c

Re: Using XML w/ Python...

2005-12-11 Thread Jay
Spoke too soon, i get this error when running amara in ActivePython >>> import amara >>> amara.parse("http://www.digg.com/rss/index.xml";) Traceback (most recent call last): File "", line 1, in ? File "C:\Python23\Lib\site-packages\amara\__init__.py", line 50, in parse if IsXml(source): Na

Re: lambda (and reduce) are valuable

2005-12-11 Thread Paul Rubin
Chris Mellon <[EMAIL PROTECTED]> writes: > As someone who does a tremendous amount of event-driven GUI > programming, I'd like to take a moment to speak out against people > using us as a testament to the virtues of lamda. Event handlers are > the most important part of event-driven code, and maki

Re: Using XML w/ Python...

2005-12-11 Thread Jay
h, i just tryed the same thing earlier today and it didnt work, but now it does, i downloaded the standalone package and now it works in activepython when it didnt before and i tryed the same thing. And yes, last time i did type python setup.py install. Thx anyway. -- http://mail.python.org

Re: Using XML w/ Python...

2005-12-11 Thread uche . ogbuji
""" No, when i said "As far as it should work since their both transparent, umm, well its not." I meant that only mine isnt, maybe urs is but for some reason it isnt. And you said amara works fine for you, ok, then could you tell me what package to install... I have installed Amara 1.1.6 for Pyt

Re: how to put form and display its result(data from database) on the same window?

2005-12-11 Thread Tim Roberts
Peter Hansen <[EMAIL PROTECTED]> wrote: > >Well, it's a matter of interpretation, isn't it? Given his vague >requirements above, it's quite valid to assume that he wants to avoid >the effects of the browser loading a new page, even if that page looks >like the previous one a lot. You may be qu

Re: lambda (and reduce) are valuable

2005-12-11 Thread David Isaac
"Chris Mellon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > As someone who does a tremendous amount of event-driven GUI > programming, I'd like to take a moment to speak out against people > using us as a testament to the virtues of lamda. Event handlers are > the most important

Re: Using XML w/ Python...

2005-12-11 Thread Jay
No, when i said "As far as it should work since their both transparent, umm, well its not." I meant that only mine isnt, maybe urs is but for some reason it isnt. And you said amara works fine for you, ok, then could you tell me what package to install... I have installed Amara 1.1.6 for Python

Re: lambda (and reduce) are valuable

2005-12-11 Thread David Isaac
> Alan Isaac wrote: > >>> #evaluate polynomial (coefs) at x using Horner's rule > >>> def horner(coefs,x): return reduce(lambda a1,a2: a1*x+a2,coefs) > > It just cannot get simpler or more expressive. "Peter Otten" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > But is it correct?

Re: newbie question about python and Tkinter

2005-12-11 Thread James Stroud
newbie wrote: [about some tkinter problems] I'm running: Python 2.3.4 (#4, Oct 25 2004, 21:40:10) [GCC 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)] on linux2 With tcl/tk 8.3 and your first sample works as expected. > I am running PYTHON and Tkinter on a windows' XP box. This is probably your proble

Re: Using XML w/ Python...

2005-12-11 Thread James
ActivePython is same as Standard Python distribution but with a few extras. "As far as it should work since their both transparent, umm, well its not." Why do you think it is not transparent? Did you try installing it on both? I have ActivePython 2.4 here and it loads amara fine. " Traceback (mo

Re: Random Number Generation?

2005-12-11 Thread Mike Meyer
[EMAIL PROTECTED] (Bengt Richter) writes: > Theoretically, the chances of getting an integer from a uniformly > random sample from an interval of real numbers is practically zero, > and even allowing for IEEE 754 double representation, Well, if we're going to be picky, the chances of getting a num

Re: OO in Python? ^^

2005-12-11 Thread Bengt Richter
On Mon, 12 Dec 2005 01:12:26 +, Tom Anderson <[EMAIL PROTECTED]> wrote: >tom > >-- >ø¤º°`°º¤øø¤º°`°º¤øø¤º°`°º¤øø¤º°`°º¤ø >---910079544-1780890058-1134349946=:30272-- [OT} (just taking liberties with your sig ;-)

Re: OO in Python? ^^

2005-12-11 Thread Alex Martelli
Tom Anderson <[EMAIL PROTECTED]> wrote: ... > Haskell is strongly and statically typed - very strongly and very > statically! Sure. > However, what it's not is manifestly typed - you don't have to put the > types in yourself; rather, the compiler works it out. For example, if i > wrote code

Re: Using XML w/ Python...

2005-12-11 Thread Jay
Ummm, my error conditions. PythonWin 2.3.5 (#62, Feb 9 2005, 16:17:08) [MSC v.1200 32 bit (Intel)] on win32. Portions Copyright 1994-2004 Mark Hammond ([EMAIL PROTECTED]) - see 'Help/About PythonWin' for further copyright information. >>> import amara Traceback (most recent call last): File

Re: TypeError: no arguments expected

2005-12-11 Thread Alex Martelli
shawn a <[EMAIL PROTECTED]> wrote: ... > Ive looked around for this exeption but nothing ive read has help in > this situation. > Any of your thoughts are greatly apprectiated. THANK!! Add "self" as the first or only parameters to all methods. Re-read the tutorial -- you're missing very crucia

Re: TypeError: no arguments expected

2005-12-11 Thread Roy Smith
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > put "self" as the first argument in all instance methods of that class. > "self" is just a convention, referring to the object instance, not a > language feature as in other language like javascript. You can call it > "me" too if you pref

Re: TypeError: no arguments expected

2005-12-11 Thread bonono
shawn a wrote: > I havet these 2 files in the same dir. This is code im writing to learn > pythong > mkoneurl.py: > #! /usr/bin/env python > > import make_ou_class > > run = make_ou_class.makeoneurl() > > > make_ou_class.py: > > class makeoneurl: > def

TypeError: no arguments expected

2005-12-11 Thread shawn a
I havet these 2 files in the same dir. This is code im writing to learn pythong mkoneurl.py: #! /usr/bin/env python import make_ou_class run = make_ou_class.makeoneurl() make_ou_class.py: class makeoneurl: def __init__(): self.command

Re: Random Number Generation?

2005-12-11 Thread Bengt Richter
On Sun, 11 Dec 2005 09:46:33 -0800 (PST), 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 >spread

Re: wxpython book

2005-12-11 Thread Bugs
Here's a more direct link: http://www.manning.com/books/rappin -- http://mail.python.org/mailman/listinfo/python-list

Re: Another newbie question

2005-12-11 Thread Mike Meyer
[EMAIL PROTECTED] (Alex Martelli) writes: > 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 d

Re: OO in Python? ^^

2005-12-11 Thread Alex Martelli
Mike Meyer <[EMAIL PROTECTED]> wrote: > 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 wo

Re: Using XML w/ Python...

2005-12-11 Thread Jay
Ok, im convinced to that i need to get Amara, I just installed 4Suite and now installed Amara. Still doesnt work because like i said before, i use ActivePython from http://www.activestate.com/Products/ActivePython/ And the requirements for Amara is Python 2.4 so Thats where we have a problem,

newbie question about python and Tkinter

2005-12-11 Thread newbie
Hello, I am a newbie and have a few questions about Python and Tkinter. I would like to create the following layout in Python: *** * * * * *

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 Python)

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 intende

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 = xmltramp.loa

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 easily

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: 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 wh

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

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: 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 r

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"

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 impo

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 rss

Re: Displaying error message in a try except?

2005-12-11 Thread Xavier Morel
Fredrik Lundh wrote: > assuming that "true" means "the message you would get if you hadn't > used a try/except", the traceback module is what you want: > > you can also inspect the exception status via the sys.exc_info() call. > e.g. > There is also the third way of catching an exception exp

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: 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: 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 t

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

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: 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 > m

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

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 sette

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 o

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 blah and take just that and put onto a text doc. Then same thing doe the part. Thats about it, i checked out some of the xml modules but dont understand how to use th

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: 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 P

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 h

Re: XML and namespaces

2005-12-11 Thread Alan Kennedy
[Paul Boddie] > However, > wouldn't the correct serialisation of the document be as follows? > > > 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 attribute in the > serialised document - I

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 in

Re: ANN: pygene0.12 - Genetic Programming&Algorithms 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 i

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 tha

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 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 -- http://

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 kn

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

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 decimal

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 ra

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 clas

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

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 no

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

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: > >> >> >>The algorithm looks very much like the source code for >>binascii.crc32 (but I'm not a C programmer). > > > Well... As you have access to the

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

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 ge

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 Py

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

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 eac

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] > > I must admit tha

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: 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: 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.

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 *st

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 cer

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 t

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), n

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

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 > soul

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: 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+services&Go2=Go&ID=118 > http://w

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 -

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 aga

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/ http://www.freene

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 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 a

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: 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 comple

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 definiti

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

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 wit

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 XM

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

  1   2   >