Re: Decline and fall of scripting languages ?

2005-08-07 Thread Paul Rubin
gene tani [EMAIL PROTECTED] writes: http://martinfowler.com/bliki/CollectionClosureMethod.html http://onestepback.org/index.cgi/Tech/Ruby/PythonAndRuby.rdoc Thanks, the way Ruby passes closure arguments to various of its library builtins is cute. PEP 343 adds something sort of comparable to

Re: Replacement for keyword 'global' good idea? (e.g. 'modulescope'or 'module' better?)

2005-08-07 Thread Paolino
Terry Reedy wrote: Paolino [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I don't think the global keyword is useful actually. What's so special in a module nemespace to be priviledged like that. The specialness of globals and locals was part of

Re: Python to C++ translation?

2005-08-07 Thread Jorgen Grahn
On 18 Jul 2005 14:39:22 -0700, Mangabasi [EMAIL PROTECTED] wrote: Hi there, I need to translate the following code (rather something similar) to C++. I have been studying C++ for the last two days but I could not find an easy way to do the following Python snippet. ... How do I make this

Python -- (just) a successful experiment?

2005-08-07 Thread Eric Pederson
Raise your hand if you think the best technology wins! For those of you with your hands in the air, tell me: if Python is so good, why has PHP achieved such greater adoption and mindshare? Why do web scripters still cling to their Perl, even in corporate environments? Why hasn't Python

Re: Proposed new collection methods

2005-08-07 Thread Christopher Subich
Jeff Schwab wrote: Robert Kern wrote: Now, if I were to do item = g(self, test).next() the generator would execute the code until it reached the yield statement which happens when it finds the first item that passes the test. That item will get returned, and execution does not return

Re: Sample code to build rfc822 mail message building

2005-08-07 Thread Jorgen Grahn
On Sat, 6 Aug 2005 08:45:30 +0100 (BST), praba kar [EMAIL PROTECTED] wrote: Dear All, I am new to python world. I have pasted my code which I used it to build rfc822 format mails for ... Still What way I can improve this code. If anyone find error kindly let me know how to correct it.

Re: Python -- (just) a successful experiment?

2005-08-07 Thread Paul Rubin
Eric Pederson [EMAIL PROTECTED] writes: Maybe: -- Automatic dependency handling -- Tightly coupled GUI package (tightly coupled ~= Pythonic) -- High level IDE (i.e. intuitive drag and drop GUI builder) -- High level database framework (perhaps a mature, killer Dabo) -- Powerful web framework

Re: Python -- (just) a successful experiment?

2005-08-07 Thread Paul Rubin
Robert Kern [EMAIL PROTECTED] writes: No it's not wrong to want these things. The problem is that we're not lacking in people posting this *same exact complaint* every month or so. We *are* lacking in people implementing these things. Eh? Nah, we keep getting lame excuses on why those things

Re: Python -- (just) a successful experiment?

2005-08-07 Thread Robert Kern
Paul Rubin wrote: Robert Kern [EMAIL PROTECTED] writes: No it's not wrong to want these things. The problem is that we're not lacking in people posting this *same exact complaint* every month or so. We *are* lacking in people implementing these things. Eh? Nah, we keep getting lame excuses

gettext again

2005-08-07 Thread cantabile
Hi, I'm failing to make it work but can't find out what's wrong. Here's what I do : test.py import gettext gettext.install('') msg = _(Message without accented characters) print msg Then I do : xgettext test.py mv message.po message pot msginit -- output

Some newbie cgi form questions...

2005-08-07 Thread googleboy
Hi there. I am having a bit of a play with teh cgi module, trying to figure out how to process a web form. I have come a little ways from reading up variou sexamples and tutes that I've found on the net, but they all leave me with a couple of questions: My code below has an attempt at

Re: Python -- (just) a successful experiment?

2005-08-07 Thread Björn Lindström
Paul Rubin http://[EMAIL PROTECTED] writes: Eh? Nah, we keep getting lame excuses on why those things aren't needed and users should just supply tenacity and expect to suffer and they should stop being wimps, and having to locate, download, and figure out how to use a dozen packages from all

Re: Some newbie cgi form questions...

2005-08-07 Thread Atila Olah
for key in form.keys(): if not form.has_key(key): # it will always be True try this: for key in form.keys(): if not form.keys()[key]: # True if it's a value is None Well, I don't exactly know the methods of the CGI module, but there are ways to access form data in Apache's mod_python

Re: Python -- (just) a successful experiment?

2005-08-07 Thread Paul Rubin
[EMAIL PROTECTED] (Björn Lindström) writes: I don't see why the things you talk about would have to be part of the main Python distribution. Ruby on Rails seems to do pretty well without being included with the core language. I haven't used Ruby on Rails but from the description I saw, its

Re: Some newbie cgi form questions...

2005-08-07 Thread Paul Rubin
Atila Olah [EMAIL PROTECTED] writes: for key in form.keys(): if not form.keys()[key]: # True if it's a value is None Ugh! I think you mean for key, value in form.items(): if not value: These days you can also say iteritems instead of items and avoid building a potentially large

Re: Some newbie cgi form questions...

2005-08-07 Thread Diez B.Roggisch
The second for loop is an attempt at trying to print all the values that were entered on the for without presenting the hidden values. I'd really like to do this, but I can't seem to figure out how to make a special case for hidden form values, nor can I find an example of how to do it in

Re: Creating a virtual file system

2005-08-07 Thread Jorgen Grahn
On 5 Aug 2005 16:47:08 -0700, Atila Olah [EMAIL PROTECTED] wrote: I'm working on a project to implement a simple cross-platform file sharing protocol (using Python) that is similar to HTTP, and I have to Like WebDAV, then? My question is: How do I implement a virtual partition that acts like

Re: Python -- (just) a successful experiment?

2005-08-07 Thread Björn Lindström
Paul Rubin http://[EMAIL PROTECTED] writes: [EMAIL PROTECTED] (Björn Lindström) writes: I don't see why the things you talk about would have to be part of the main Python distribution. Ruby on Rails seems to do pretty well without being included with the core language. I haven't used Ruby

Abstract methods in python - is this a good way ?)

2005-08-07 Thread Philipp H. Mohr
Hello, I would like to use abstract methods in python to force some of the classes to implement common methods. I found this web page and wonder if it is a good way of implementing them: http://www.lychnis.net/blosxom/programming/python-abstract-methods-3.lychnis Also could some one please

Re: Python -- (just) a successful experiment?

2005-08-07 Thread Neil Hodgson
Paul Rubin: I haven't used Ruby on Rails but from the description I saw, its distro includes everything needed, which I assume includes Ruby itself. Whatever led you to assume that? * Install Ruby * Install RubyGems * Invoke gem to install rails

Re: Abstract methods in python - is this a good way ?)

2005-08-07 Thread Robert Kern
Philipp H. Mohr wrote: Hello, I would like to use abstract methods in python to force some of the classes to implement common methods. I found this web page and wonder if it is a good way of implementing them: http://www.lychnis.net/blosxom/programming/python-abstract-methods-3.lychnis

Re: Python -- (just) a successful experiment?

2005-08-07 Thread Kay Schluehr
Eric Pederson wrote: Raise your hand if you think the best technology wins! Who is interested in such a matter? Is this a forum dedicated to some programming language or a popularity contest? If Python dies in a few years / looses attention but the Python Zen survives in another language I have

Re: Python -- (just) a successful experiment?

2005-08-07 Thread Peter Decker
On 07 Aug 2005 02:42:43 -0700, Paul Rubin http://phr.cx@nospam.invalid wrote: [EMAIL PROTECTED] (Björn Lindström) writes: I don't see why the things you talk about would have to be part of the main Python distribution. Ruby on Rails seems to do pretty well without being included with the

Re: Making a timebomb

2005-08-07 Thread Peter Hansen
Cantankerous Old Git wrote: Peter Hansen wrote: Cantankerous Old Git wrote: The dirty way, which can leave corrupt half-written files and other nasties, is something like sys.exit(). sys.exit() won't help you if your server is running in the main thread, nor if your server thread is not

Re: Python -- (just) a successful experiment?

2005-08-07 Thread Paul Rubin
Peter Decker [EMAIL PROTECTED] writes: Hmmm. Plonk. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python -- (just) a successful experiment?

2005-08-07 Thread Paul Rubin
[EMAIL PROTECTED] (Björn Lindström) writes: I haven't used Ruby on Rails but from the description I saw, its distro includes everything needed, which I assume includes Ruby itself. Hm... did you read my posting before you answered? That's exactly the kind of distro I suggested that you

Re: seek python parser

2005-08-07 Thread Paul Boddie
I tend to use the compiler module: http://docs.python.org/lib/compiler.html With the output of the parsing functions I selectively inspect the AST nodes using the named attributes listed in the documentation: http://docs.python.org/lib/module-compiler.ast.html For cases where one just needs to

Re: Python -- (just) a successful experiment?

2005-08-07 Thread Paul Boddie
Eric Pederson wrote: Why do web scripters still cling to their Perl, even in corporate environments? Ignorance. One could argue that Python should be promoted more, but Perl had the cool tool buzz a good ten years ago. Such habits don't fade away very quickly. Why hasn't Python made inroads

Re: Python -- (just) a successful experiment?

2005-08-07 Thread Björn Lindström
Paul Rubin http://[EMAIL PROTECTED] writes: That would imply that it included the Ruby language. Nothing stops the Ruby on Rails packagers from making the Ruby on Rails distro a superset of the Ruby distro, after all. So you agree with me then? That _was_ exactly my point, after all. Not that

Grayson's Tkinter Programming

2005-08-07 Thread EuGeNe
Just noticed that it is now availabe as an ebook from Manning : http://www.manning.com/books/grayson I bought an edition on abebooks for a little fortune a few months ago ... -- http://mail.python.org/mailman/listinfo/python-list

Re: Python -- (just) a successful experiment?

2005-08-07 Thread Paul Rubin
[EMAIL PROTECTED] (Björn Lindström) writes: That would imply that it included the Ruby language. Nothing stops the Ruby on Rails packagers from making the Ruby on Rails distro a superset of the Ruby distro, after all. So you agree with me then? That _was_ exactly my point, after all. Not

Re: Python -- (just) a successful experiment?

2005-08-07 Thread Roy Smith
Paul Boddie [EMAIL PROTECTED] wrote: Perl had the cool tool buzz a good ten years ago. That's true, but I think it understates just how important a development Perl really was. Before Perl, unix scripting consisted of awk, sed, grep, tr, a random assortment of incompatible shells, and lots of

Re: Python -- (just) a successful experiment?

2005-08-07 Thread Martin P. Hellwig
Kay Schluehr wrote: Eric Pederson wrote: Raise your hand if you think the best technology wins! Who is interested in such a matter? Is this a forum dedicated to some programming language or a popularity contest? If Python dies in a few years / looses attention but the Python Zen

Re: Python -- (just) a successful experiment?

2005-08-07 Thread Robert Kern
Paul Rubin wrote: [EMAIL PROTECTED] (Björn Lindström) writes: That would imply that it included the Ruby language. Nothing stops the Ruby on Rails packagers from making the Ruby on Rails distro a superset of the Ruby distro, after all. So you agree with me then? That _was_ exactly my point,

Re: Python -- (just) a successful experiment?

2005-08-07 Thread Paul Rubin
Paul Boddie [EMAIL PROTECTED] writes: Why do web scripters still cling to their Perl, even in corporate environments? Ignorance. One could argue that Python should be promoted more, but Perl had the cool tool buzz a good ten years ago. Such habits don't fade away very quickly. I don't

Re: Python -- (just) a successful experiment?

2005-08-07 Thread Brian Beck
Eric Pederson wrote: Raise your hand if you think the best technology wins! For those of you with your hands in the air, tell me: if Python is so good, why has PHP achieved such greater adoption and mindshare? Why do web scripters still cling to their Perl, even in corporate

Re: Python -- (just) a successful experiment?

2005-08-07 Thread Paul Rubin
Robert Kern [EMAIL PROTECTED] writes: As a maintainers of a convenient unified distro, I have to say that it's a losing strategy. No matter how much you include, for every person that tells you, Thank you, you've made my Python experience better, there are three who say, Thanks, but could you

Re: Python -- (just) a successful experiment?

2005-08-07 Thread Paul Boddie
Paul Rubin wrote: Come on, this is silly, Java is a lot more cumbersome for doing small, quick projects, but Python doesn't have the language discipline or the library support to do heavyweight projects that Java can. I'm not necessarily arguing that Python goes all the way up to the upper

Re: Python -- (just) a successful experiment?

2005-08-07 Thread Kay Schluehr
Martin P. Hellwig wrote: Kay Schluehr wrote: Eric Pederson wrote: Raise your hand if you think the best technology wins! Who is interested in such a matter? Is this a forum dedicated to some programming language or a popularity contest? If Python dies in a few years / looses

Re: Some newbie cgi form questions...

2005-08-07 Thread googleboy
for key in form.keys():Yes, I know which fields are hidden because I made them that way, but I am trying to figure out a way I can iterate over the fields and do one thing with hidden fields (assign them to variables that tell the form how to process) and a different thing with non hidden

socket + file i/o question

2005-08-07 Thread John
I am sending a file on a tcp socket using the following code while 1: buf = os.read(fd, 4096) if not buf: break print total, len(buf)

amazon web services/api...

2005-08-07 Thread bruce
hi... has anybody ever played/successfully with the amazon- web services/api? i'm trying to figure out how i can use the browsenodeid to generate ISBN information for a book. the examples i've seen on various sites haven't been much help yet. thanks -bruce [EMAIL PROTECTED] --

WSGI-server in the standard distro?

2005-08-07 Thread Thomas W
Will there be a WSGI-server like BaseHTTPServer etc in the standard distro? I think that would increase the adoptation of the WSGI-standard. A new web-framework for python pops up every other week and more and more support WSGI. Why not focus on getting an optimized, production-grade fully

Re: socket + file i/o question

2005-08-07 Thread John
Here is what the send and recieved number of bytes show up as: Filesize being sent = 507450 Server sending file to client... (total size sent , buffer size) ... 491520 4096 495616 4096 499712 4096 503808 3642 ./server.py: (107, 'Transport endpoint is not connected') On the client side, the bytes

Chopping off spaces at both ends

2005-08-07 Thread Madhusudan Singh
Hi I am a newbie to python and am using it to interface some of my lab equipment. How does one get rid of spaces at both ends of a string ? A little like the trim() intrinsic in fortran 95. One of my instruments is returning a string that has one or more blanks in it,

Re: Chopping off spaces at both ends

2005-08-07 Thread Kay Schluehr
Use the strip() method. Example: \t abc\n.strip() abc Variants are lstrip() and rstrip(). Regards, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Some newbie cgi form questions...

2005-08-07 Thread Devan L
googleboy wrote: for key in form.keys():Yes, I know which fields are hidden because I made them that way, but I am trying to figure out a way I can iterate over the fields and do one thing with hidden fields (assign them to variables that tell the form how to process) and a different thing

Optional assignments ?

2005-08-07 Thread Madhusudan Singh
Hi Is it possible to have something like : a,b,c,d=fn(that returns 10 return values) ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Optional assignments ?

2005-08-07 Thread Robert Kern
Madhusudan Singh wrote: Hi Is it possible to have something like : a,b,c,d=fn(that returns 10 return values) ? a,b,c,d = fn()[:4] -- Robert Kern [EMAIL PROTECTED] In the fields of hell where the grass grows high Are the graves of dreams allowed to die. -- Richard Harter --

authentication project

2005-08-07 Thread jayt33
im working on a project that involves creating a back end solution to authenticate and manage user accounts for a website. im new to python and am looking for some good references that can help me with this task. the requirements for the project are as follows: A new user can register with

Re: gettext again

2005-08-07 Thread stasz
On Sun, 07 Aug 2005 11:09:14 +0200, cantabile wrote: Hi, I'm failing to make it work but can't find out what's wrong. Here's what I do : [] How come ? What's wrong with what I am doing ? Start with this little howto about gettext. http://childsplay.sourceforge.net/translate-howto.html

Re: SWIG again

2005-08-07 Thread Jerry He
Can you tell me how to completely remove that module? For cygwin, it should be in whatever corresponds to /usr/lib/python2.4/site-packages . -- Robert Kern [EMAIL PROTECTED] Hi, Do you mean to say that all I have to do is delete example.py and the build folder? (note: I didn't

Re: Decline and fall of scripting languages ?

2005-08-07 Thread c d saunter
Kay Schluehr ([EMAIL PROTECTED]) wrote: : No good news for scripting-language fans: : http://www.phpmag.net/itr/news/psecom,id,23284,nodeid,113.html Just as well I ditched a scripting language for Python then... cds -- http://mail.python.org/mailman/listinfo/python-list

Re: Optional assignments ?

2005-08-07 Thread Madhusudan Singh
Robert Kern wrote: Madhusudan Singh wrote: Hi Is it possible to have something like : a,b,c,d=fn(that returns 10 return values) ? a,b,c,d = fn()[:4] Thanks ! -- http://mail.python.org/mailman/listinfo/python-list

Re: SWIG again

2005-08-07 Thread Robert Kern
Jerry He wrote: Can you tell me how to completely remove that module? For cygwin, it should be in whatever corresponds to /usr/lib/python2.4/site-packages . -- Robert Kern [EMAIL PROTECTED] Hi, Do you mean to say that all I have to do is delete example.py and the build folder?

Re: Some newbie cgi form questions...

2005-08-07 Thread Diez B.Roggisch
Traceback (most recent call last): File /var/www/users/senta/html/gobooks/cgi/form.py, line 35, in ? if not form.keys()[key]: TypeError: list indices must be integers As you can see, I am using python 2.3 (my web service provider is responsible for this - I'd use 2.4.1 if I could)

Re: Wheel-reinvention with Python

2005-08-07 Thread Mike Meyer
Dennis Lee Bieber [EMAIL PROTECTED] writes: On 06 Aug 2005 17:27:33 -0700, Paul Rubin http://[EMAIL PROTECTED] declaimed the following in comp.lang.python: Mike Meyer [EMAIL PROTECTED] writes: Is there a free language you consider successful? I can't think of any that are a lot more (i.e.

Re: Fat and happy Pythonistas

2005-08-07 Thread Mike Meyer
Dennis Lee Bieber [EMAIL PROTECTED] writes: On Sat, 06 Aug 2005 21:37:54 -0400, Mike Meyer [EMAIL PROTECTED] declaimed the following in comp.lang.python: The concensus of this group is a *long* way from the debate has moved on. I agree that it's the concensus of this group - but this is a

Re: gettext again

2005-08-07 Thread cantabile
stasz a écrit : On Sun, 07 Aug 2005 11:09:14 +0200, cantabile wrote: Hi, I'm failing to make it work but can't find out what's wrong. Here's what I do : [] How come ? What's wrong with what I am doing ? Start with this little howto about gettext.

Re: Some newbie cgi form questions...

2005-08-07 Thread Robert Kern
Diez B.Roggisch wrote: Traceback (most recent call last): File /var/www/users/senta/html/gobooks/cgi/form.py, line 35, in ? if not form.keys()[key]: TypeError: list indices must be integers As you can see, I am using python 2.3 (my web service provider is responsible for this - I'd use

Firedrop2 Updated Tutorial and Podcast

2005-08-07 Thread UrsusMaximus
I have revised, updated and added to the Mini How-To for intalling and setting up Firedrop2, and I have also posted a podcast about Firedrop2, both can be found on my a href=http://www.awaretek.com/weblog/index.html;Blog/a. Firedrop2 is a client side weblog and content management tool written by

PEP: Specialization Syntax

2005-08-07 Thread Nicolas Fleury
Hi everyone, I would to know what do you think of this PEP. Any comment welcomed (even about English mistakes). PEP:XXX Title: Specialization Syntax Version:$Revision: 1.10 $ Last-Modified: $Date: 2003/09/22 04:51:49 $ Author: Nicolas Fleury nidoizo at gmail.com Status:

Re: PEP: Specialization Syntax

2005-08-07 Thread Martin v. Löwis
Nicolas Fleury wrote: Hi everyone, I would to know what do you think of this PEP. Any comment welcomed (even about English mistakes). -1. I don't see the point of this PEP. Apparently, you want to define parametrized types - but for what purpose? I.e. what are the specific use cases for the

visual studio 2005

2005-08-07 Thread wilf
Has anyone had success compiling python with this? -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating a virtual file system

2005-08-07 Thread Jeff Schwab
Atila Olah wrote: I'm working on a project to implement a simple cross-platform file sharing protocol (using Python) that is similar to HTTP, and I have to write a GUI for Windows and Linux. But let's start with the harder one: Windows. My question is: How do I implement a virtual partition

Re: PEP: Specialization Syntax

2005-08-07 Thread Nicolas Fleury
Martin v. Löwis wrote: -1. I don't see the point of this PEP. Apparently, you want to define parametrized types - but for what purpose? I.e. what are the specific use cases for the proposed syntax, and why do you need to change the language to support these use cases? I very much doubt that

Re: Euclid's Algorithm in Python?

2005-08-07 Thread Erik the Red
So, I did the following: --- a=input(Give me an integer) b=input(Give me another integer) def gcd(a,b): if a b: a, b = b, a while b != 0: a, b = b, a % b return a --- But, in the xterm, it terminates after Give me another integer. Is Euclid's Algorithm supposed to

Re: Euclid's Algorithm in Python?

2005-08-07 Thread Reinhold Birkenfeld
Erik the Red wrote: So, I did the following: --- a=input(Give me an integer) b=input(Give me another integer) def gcd(a,b): if a b: a, b = b, a while b != 0: a, b = b, a % b return a --- But, in the xterm, it terminates after Give me another integer.

Re: Replacement for keyword 'global' good idea? (e.g. 'modulescope'or 'module' better?)

2005-08-07 Thread Bengt Richter
On Sat, 6 Aug 2005 19:28:13 -0400, Terry Reedy [EMAIL PROTECTED] wrote: Paolino [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I don't think the global keyword is useful actually. What's so special in a module nemespace to be priviledged like that. The

Re: Fat and happy Pythonistas (was Re: Replacement for keyword'global' good idea? ...)

2005-08-07 Thread Terry Reedy
Mike Meyer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] http://martinfowler.com/articles/languageWorkbench.html Um - I see no mention of AST in that article at all. He's mostly talking about Language Oriented Programming (seems to be another term to describe DSLs) and Language

Re: Chopping off spaces at both ends

2005-08-07 Thread Bengt Richter
On 7 Aug 2005 10:14:33 -0700, Kay Schluehr [EMAIL PROTECTED] wrote: Use the strip() method. Example: \t abc\n.strip() abc Variants are lstrip() and rstrip(). and also occasionally useful: 'abc123cab'.strip('bca') '123' I.e., a strip argument as an unordered set of characters that

Re: Fat and happy Pythonistas (was Re: Replacement for keyword'global' good idea? ...)

2005-08-07 Thread Terry Reedy
John Roth [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] http://martinfowler.com/articles/languageWorkbench.html This clarified your proposal for Python considerably. So I note that now and especially once the AST compiler is completed, you are quite free to start a Python AST

Metaclasses and new-style classes

2005-08-07 Thread Jan-Ole Esleben
Hi! I've just posted a question about metaclasses in ZOPE on the ZOPE list, and one of the replies said that metaclasses (at least painless metaclasses) cannot be used without new-style classes (or rather, that they don't work where you cannot explicitly use new-style classes). I haven't so far

Re: Metaclasses and new-style classes

2005-08-07 Thread jepler
This may be a limitation Zope imposes. I wrote this program: #--- class M(type): def __new__(*args): print new M, args class T(object): __metaclass__ = M

Re: Some newbie cgi form questions...

2005-08-07 Thread googleboy
Robert Kern wrote: Diez B.Roggisch wrote: Traceback (most recent call last): File /var/www/users/senta/html/gobooks/cgi/form.py, line 35, in ? if not form.keys()[key]: TypeError: list indices must be integers As you can see, I am using python 2.3 (my web service provider is

RE: WSGI-server in the standard distro?

2005-08-07 Thread Robert Brewer
Having a HTTP 1.0/1.1-compliant production-grade WSGI-only server in the distro would be sweet :-) I might be demanding a bit much here, but still ... To demand it might be a bit much, but to expect it...? ;) I don't think anyone's going to drop what they're doing and go code such a server

Re: Metaclasses and new-style classes

2005-08-07 Thread Jordan Rastrick
Correct me if I'm wrong, but I think the OP was asking if metaclasses work with old-style classes, not new-style. [EMAIL PROTECTED] wrote: This may be a limitation Zope imposes. I wrote this program: #--- class M(type):

Re: Euclid's Algorithm in Python?

2005-08-07 Thread Jordan Rastrick
Good point. I suppose I'd only ever seen it implemented with the if test, but you're right, the plain while loop should work fine. Silly me. def gcd(a,b): while b != 0: a, b = b, a%b return a Even nicer. -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP: Specialization Syntax

2005-08-07 Thread Bengt Richter
On Sun, 07 Aug 2005 16:22:11 -0400, Nicolas Fleury [EMAIL PROTECTED] wrote: Hi everyone, I would to know what do you think of this PEP. Any comment welcomed (even about English mistakes). PEP: XXX Title: Specialization Syntax Version: $Revision: 1.10 $ Last-Modified:

Re: PEP: Specialization Syntax

2005-08-07 Thread Bengt Richter
On Sun, 07 Aug 2005 17:20:25 -0400, Nicolas Fleury [EMAIL PROTECTED] wrote: Martin v. Löwis wrote: -1. I don't see the point of this PEP. Apparently, you want to define parametrized types - but for what purpose? I.e. what are the specific use cases for the proposed syntax, and why do you need

Re: gettext again

2005-08-07 Thread cantabile
stasz a écrit : On Sun, 07 Aug 2005 21:33:21 +0200, cantabile wrote: stasz a écrit : On Sun, 07 Aug 2005 11:09:14 +0200, cantabile wrote: Hi, I'm failing to make it work but can't find out what's wrong. Here's what I do : [] How come ? What's wrong with what I am doing ? Start

Re: Euclid's Algorithm in Python?

2005-08-07 Thread Bengt Richter
On 7 Aug 2005 17:31:02 -0700, Jordan Rastrick [EMAIL PROTECTED] wrote: Good point. I suppose I'd only ever seen it implemented with the if test, but you're right, the plain while loop should work fine. Silly me. def gcd(a,b): while b != 0: a, b = b, a%b return a Even nicer.

Re: Proposed new collection methods

2005-08-07 Thread Terry Reedy
Mike Meyer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Another thread pointed out a couple of methods that would be nice to have on Python collections: find and inject. Since Python does not have a collections superclass, I am puzzled as to what you are really proposing. find

Re: Fat and happy Pythonistas (was Re: Replacement for keyword'global' good idea? ...)

2005-08-07 Thread Bengt Richter
On Sun, 7 Aug 2005 18:37:42 -0400, Terry Reedy [EMAIL PROTECTED] wrote: John Roth [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] http://martinfowler.com/articles/languageWorkbench.html This clarified your proposal for Python considerably. So I note that now and especially once

Re: Euclid's Algorithm in Python?

2005-08-07 Thread [EMAIL PROTECTED]
Erik the Red wrote: So, I did the following: --- a=input(Give me an integer) b=input(Give me another integer) def gcd(a,b): if a b: a, b = b, a while b != 0: a, b = b, a % b return a --- But, in the xterm, it terminates after Give me another integer.

Re: PEP: Specialization Syntax

2005-08-07 Thread Nicolas Fleury
Bengt Richter wrote: __specialize__ Special Member Function. By Member Function do you mean anything different from method? No, I should have written method. C++ habit. The first element of this proposal is the addition of the __specialize__ special member function. The

Re: PEP: Specialization Syntax

2005-08-07 Thread Nicolas Fleury
Bengt Richter wrote: I don't understand why you wouldn't give the function arg a different name in the first place instead of via a temporary intermediary binding, e.g., def makeType(someArgument_alias): class MyObject: someArgument = someArgument_alias return

Splitting a string into groups of three characters

2005-08-07 Thread [EMAIL PROTECTED]
Hi, Is there a function that split a string into groups, containing an x amount of characters? Ex. TheFunction(Hello World,3) Returns: ['Hell','o W','orl','d'] Any reply would be truly appreciated. Thank You, -- http://mail.python.org/mailman/listinfo/python-list

Re: Splitting a string into groups of three characters

2005-08-07 Thread John Machin
[EMAIL PROTECTED] wrote: Hi, Is there a function that split a string into groups, containing an x amount of characters? Ex. TheFunction(Hello World,3) Returns: ['Hell','o W','orl','d'] Any reply would be truly appreciated. Thank You, Maybe, somewhere out there -- you

Re: Python's CSV reader

2005-08-07 Thread Stephan
Andrew McLean wrote: You are welcome. One point. I think there have been at least two different interpretations of precisely what you task is. I had assumed that all the different header lines contained data for the same fields in the same order, and similarly that all the detail lines

Re: Python -- (just) a successful experiment?

2005-08-07 Thread Terry Reedy
Paul Rubin http://phr.cx@NOSPAM.invalid wrote in message news:[EMAIL PROTECTED] [EMAIL PROTECTED] (Björn Lindström) writes: Actually that proliferation is one of the culprits in Python being a pain to deal with. I'm personally not a GUI fetishist and Tkinter has been good enough for the

Re: Splitting a string into groups of three characters

2005-08-07 Thread gene tani
Um, you shd 1st search cookbook, or Vaults Parnassu, dmoz python section, pypackage: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/347689 http://www.codezoo.com/ http://www.vex.net/parnassus/ http://www.pypackage.org/packages -- http://mail.python.org/mailman/listinfo/python-list

Re: Fat and happy Pythonistas (was Re: Replacement forkeyword'global' good idea? ...)

2005-08-07 Thread Terry Reedy
Bengt Richter [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I think the relationship of abstract entities and their concrete representations is very interesting. ditto BTW, maybe this is a place to mention the concept of an AST decorator, that works like a function

Re: Splitting a string into groups of three characters

2005-08-07 Thread [EMAIL PROTECTED]
Thank You, For your help, I guess I will just make a couple of these functions and find out which one is that fastest. -- http://mail.python.org/mailman/listinfo/python-list

Re: IronPython 0.9 Released

2005-08-07 Thread Al Christians
EP wrote: yes, my apologies to all things Iron and or Python. language and version can be confusing if one stays up late without coffee, or perhaps if one has not been debugging their English code properly. Still, it's a bit of a PITB to me that it says XP and not Win2000. Al --

Re: Splitting a string into groups of three characters

2005-08-07 Thread Terry Reedy
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Is there a function that split a string into groups, containing an x amount of characters? There have been previous threads giving various solutions (which generally are not specific to strings). You might find some some by searching

Re: Splitting a string into groups of three characters

2005-08-07 Thread John Machin
gene tani wrote: Um, you shd 1st search cookbook, or Vaults Parnassu, dmoz python section, pypackage: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/347689 which includes e.g. def each_slice_lol(listin,n): non-overlapp'g slices, return (list of lists) len_listin=len(listin)

Re: socket + file i/o question

2005-08-07 Thread John
I found the problem. There was a recv that was not from an open socket... Sorry abt the trouble, --j -- http://mail.python.org/mailman/listinfo/python-list

zipped socket

2005-08-07 Thread John
Is there anyway open a socket so that every send/listen/recv goes thru a zipping/unzipping process automatically? Thanks, --j -- http://mail.python.org/mailman/listinfo/python-list

OT: World's largest Python caught!:)

2005-08-07 Thread Ashok Rajasingh
Hi Can I please get some information on this python? I saw a brief news clip last year am very keen to know more. Thanks Ashok Rajasingh 21 Cumberland street New Plymouth New Zealand +646 7575698 (home) 7599592 (work) Attention:The information contained in this

  1   2   >