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

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 made

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 doe

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

2005-08-07 Thread Robert Kern
Eric Pederson wrote: [snip yet another article repeating what's been said over and over again for years] > Is it wrong to appreciate Python as a language, but want to have the nice > accoutrements we see in some competing languages? No it's not wrong to want these things. The problem is that w

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 corr

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

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 thi

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 la

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

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 validation

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

2005-08-07 Thread Björn Lindström
Paul Rubin 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

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 m

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 d

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

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 i

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 l

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

2005-08-07 Thread Björn Lindström
Paul Rubin 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 u

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 tel

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 http://download.rubyonrails.c

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

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: Making a timebomb

2005-08-07 Thread Cantankerous Old Git
Peter Hansen wrote: > Cantankerous Old Git wrote: > >> [EMAIL PROTECTED] wrote: >> >>> I have a server that right now runs infinitely. I'd like to make it >>> die after some amount of time. >> >> >> The proper way to do it is to have the timer set a flag that the other >> threads check regular

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 w

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 t

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 y

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 inro

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

2005-08-07 Thread Björn Lindström
Paul Rubin 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

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 al

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 l

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 Z

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_ exactl

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

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 enviro

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 co

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 e

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

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

2005-08-07 Thread Robert Kern
Paul Rubin wrote: > 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 w

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 fields

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) conn.send(b

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] -- http://mail.py

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 document

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

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 th

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 the

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? (not

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"

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

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

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 t

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

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 thi

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 http://www.awaretek.com/weblog/index.html";>Blog. Firedrop2 is a client side weblog and content management tool written by Hans No

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 Status: Draft Type: S

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 p

Re: gettext again

2005-08-07 Thread stasz
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 ? >

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 part

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 suppo

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 m

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 li

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)

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 se

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 AS

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

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 s

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 y

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 ?

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 >

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.

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 esp

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

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 o

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" > l

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 sear

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=le

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

  1   2   >