Re: Question - What is a faster alternative to recursion?

2005-03-02 Thread Stephen Thorne
On Wed, 02 Mar 2005 00:58:58 -0600, actuary77 <[EMAIL PROTECTED]> wrote: > Yes, iteration is 100 times faster than recursion. > > The problem I have is: > > # need to call this function 50 times with seed of 10 > (afunc(afunc(afunc(... afunc(10)) > > required_iterations_ 50 > funct

why is http://pysqlite.org down ?

2005-03-02 Thread martijn
H! I'm trying things with databases and Python 2.4 for windows2000. And now I want to try pysqlite. but http://pysqlite.org/ is down and http://pysqlite.sourceforge.net/ redirect to pysqlite.org does someone know if this is the latest version http://sourceforge.net/projects/pysqlite/ pysqlite 2.

Re: Help- Recursion v. Iter Speed comparison

2005-03-02 Thread actuary77
Robert Kern wrote: actuary77 wrote: Recurse from time: 4.305942779541 seconds Iter from time: 0.009904632568359 seconds No comparison, why is recursion so slow? I usually don't delve too deeply into language design issues, so I hope others will correct me if I'm wrong. Recursion

Re: Regular Expressions: large amount of or's

2005-03-02 Thread André Søreng
Bill Mill wrote: On Tue, 01 Mar 2005 22:04:15 +0100, André Søreng <[EMAIL PROTECTED]> wrote: Kent Johnson wrote: André Søreng wrote: Hi! Given a string, I want to find all ocurrences of certain predefined words in that string. Problem is, the list of words that should be detected can be in the ord

Re: Help- Recursion v. Iter Speed comparison

2005-03-02 Thread Robert Kern
actuary77 wrote: # # non-generator # def f1(afunc,aseed,n): values = [afunc(aseed)] for i in range(n-1): values.append(afunc(values[-1])) return values[-1] _b=time() for _i in range(

Re: bsddb for k, v in db.items(): do order the numbers ?

2005-03-02 Thread Denis S. Otkidach
On Mon, 28 Feb 2005 11:48:44 -0500 Christopher De Vries <[EMAIL PROTECTED]> wrote: > If you want your key, value pairs in a certain order you have to sort > them yourself. Dictionaries and bsddb keys are unsorted. You are not right, records in BTree (btopen) are certainly sorted. For positive in

Running Python Scripts With 'sudo'

2005-03-02 Thread Tim Daneliuk
Given that setuid is a Bad Thing for scripts, what is the general consensus here on running a Python script via 'sudo' to give it root system access? Is this reasonably secure, or am I still asking for trouble? TIA, -- Tim

Re: Tkinter and Text() widget interactivity ?

2005-03-02 Thread Tonino
Many thanks for this - will give it a bash ;) Tonino -- http://mail.python.org/mailman/listinfo/python-list

creating csv file from

2005-03-02 Thread Sandeep Avinash Gohad
Please Help me I wish to download the data from any URL (from any website) and then want to save into ".csv" format. In the python documentation "12.20 csv -- CSV File Reading and Writing" import csv reader = csv.reader(file("some.csv")) for row in reader:     print row How can i use the url as

Re: Regular Expressions: large amount of or's

2005-03-02 Thread André Søreng
Daniel Yoo wrote: Kent Johnson <[EMAIL PROTECTED]> wrote: :> Given a string, I want to find all ocurrences of :> certain predefined words in that string. Problem is, the list of :> words that should be detected can be in the order of thousands. :> :> With the re module, this can be solved somethin

Re: function expression with 2 arguments

2005-03-02 Thread Xah Lee
once i have a expresson of a function, how to apply it to arguments? e.g. if i have lambda x,y:x+y i have to applied it to a,b in my code. Xah [EMAIL PROTECTED] http://xahlee.org/PageTwo_dir/more.html -- http://mail.python.org/mailman/listinfo/python-list

i18n: looking for expertise

2005-03-02 Thread klappnase
Hello all, I am trying to internationalize my Tkinter program using gettext and encountered various problems, so it looks like it's not a trivial task. After some "research" I made up a few rules for a concept that I hope lets me avoid further encoding trouble, but I would feel more confident if s

Re: Need some simple coding help

2005-03-02 Thread mx2k
indeed, we're it is our combat timeline. we enter the initiative and reaction time, it should find out the lowest then the next, then the 'n'th etc. and shouw it on the screen like Next action 'Character Name1' at tick No 'Initiative1 2nd action 'Character Name2' at tick No 'Initiative2' [...

Re: What's the cost of using hundreds of threads?

2005-03-02 Thread Przemysław Różycki
I'm a bit confused by your math. Fifty connections should be 102 threads, which is quite reasonable. My formula applies to one forwarded ('loadbalanced') connection. Every such connection creates further n connections (pipes) which share the load. Every pipe requires two threads to be spawned. E

Re: Need some simple coding help

2005-03-02 Thread mx2k
ah, and sorry for that 'unreadable' code, but that was our first try of coding ever. we're working through the python documentaion right now - and - thanks to the post by STeVe we at last now that we have to construct a class for our purpose. Thx for any help mx2k -- http://mail.python.org/mailm

Re: Regular Expressions: large amount of or's

2005-03-02 Thread Ola Natvig
André Søreng wrote: Yes, but I was looking for a solution which would scale. Searching through the same string 1+++ times does not seem like a suitable solution. André Just for curiosity, what would a regexp do? Perhaps it's a clue in how you could do this in the way regexp's are executed.

Re: What's the cost of using hundreds of threads?

2005-03-02 Thread Przemysław Różycki
Thanks for your comments on winXP threads implementation. You confirmed me in conviction that I shouldn't use windows. Personally I use linux with 2.6.10 kernel, so hopefully I don't have to share your grief. ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: Non-blocking input on windows, like select in Unix

2005-03-02 Thread fraca7
Jonathan Fine a écrit : Paul Rubin wrote: As I recall, some posts to this list say that Windows provides non-blocking i/o for sockets but not for files. No, Windows does provide non-blocking I/O for regular files, but it's a completely different mechanism than the one used by winsock. You'll have

Re: function expression with 2 arguments

2005-03-02 Thread Roel Schroeven
Xah Lee wrote: > once i have a expresson of a function, how to apply it to arguments? > > e.g. if i have > lambda x,y:x+y > i have to applied it to a,b in my code. OK, I'll bite. As with any other callable, you can simply call it like this: a = 4 b = 24 (lambda x, y: x+y)(a, b) Of course, you

Re: Regular Expressions: large amount of or's

2005-03-02 Thread André Søreng
Ola Natvig wrote: André Søreng wrote: Yes, but I was looking for a solution which would scale. Searching through the same string 1+++ times does not seem like a suitable solution. André Just for curiosity, what would a regexp do? Perhaps it's a clue in how you could do this in the way reg

Re: What's the cost of using hundreds of threads?

2005-03-02 Thread Nick Coghlan
Steve Holden wrote: Apache, for example, can easily spawn more threads under Windows, and I've written code that uses 200 threads with excellent performance. Things seem to slow down around the 2,000 mark for some reason I'm not familiar with. As far as I know, the default Windows thread stack s

Re: looking for expertise

2005-03-02 Thread Neil Hodgson
Michael: > 5. file operations seem to be delicate; at least I got an error when I > passed a filename that contains special characters as unicode to > os.access(), so I guess that whenever I do file operations > (os.remove(), shutil.copy() ...) the filename should be encoded back > into system enc

Re: Faster way to do this...

2005-03-02 Thread Will McGugan
Warren Postma wrote: Will McGugan wrote: Isn't that equivalent to simply.. nums= range(100) I remember the day I first realized that 900 lines of some C++ program I was working on could be expressed in three lines of python. Ahh. Lately I've found myself commenting C++ code with the equivalent P

Online Programming Contest (Python solutions accepted)

2005-03-02 Thread Sridhar
Hi, We, the students of CEG, Anna University [1] are organizing an online programming contest as part of aBaCus [2] 2005. The contest itself will start on 6th March 2005 at 1:00 pm IST [3] and will end after 5 hours. You have to solve the problems posted at the start of the contest. Teams ranki

Re: reuse validation logic with descriptors

2005-03-02 Thread Nick Coghlan
David S. wrote: Steve, and others, thanks for the help. This and Michael Spencer's reply at http://article.gmane.org/gmane.comp.python.general/390478 have been very helpful in getting the descriptor definition clear. For me, it has taken reading http://users.rcn.com/python/download/Descriptor.ht

Re: Regular Expressions: large amount of or's

2005-03-02 Thread Gurpreet Sachdeva
Can divide the regex on the bases of alphabets they are starting with or can iterate on the list. Regards, Garry http://garrythegambler.blogspot.com/ On Wed, 02 Mar 2005 12:50:01 +0100, André Søreng <[EMAIL PROTECTED]> wrote: > Ola Natvig wrote: > > André Søreng wrote: > > > >> > >> > >> Yes, b

Re: Initializing subclasses of tuple

2005-03-02 Thread Nick Coghlan
gry@ll.mit.edu wrote: To inherit from an immutable class, like string or tuple, you need to use the __new__ member, not __init__. See, e.g.: http://www.python.org/2.2.3/descrintro.html#__new__ Any volunteers out there willing to put some words about __new__ together for the main Python docs, plea

Re: assigning a custom mapping type to __dict__

2005-03-02 Thread Nick Coghlan
Steven Bethard wrote: The problem with inheriting from dict is that you then need to override *all* the methods in the dict object, because they all go straight to Python's dict'c C code functions. So just because you redefine __getitem__ doesn't mean you don't still have to redefine __contains

Re: assigning a custom mapping type to __dict__

2005-03-02 Thread Nick Coghlan
Steven Bethard wrote: support. Inheriting from dict likely means you have to redefine a bunch of functions to raise Exceptions saying that they're unsupported. Hmm. . . We've got the NotImplemented singleton already to let special methods say "I thought I might be able to handle this, but I can'

Re: Decimal, __radd__, and custom numeric types...

2005-03-02 Thread Nick Coghlan
Blake T. Garretson wrote: Thanks for the suggestions and modified module. I will probably just use this "fixed" module to solve my immediate problem. Expect its performance to be worse than the standard version - it does the right thing, but it sure ain't pretty. . . Cheers, Nick. -- Nick Coghla

PEP 246 revision

2005-03-02 Thread boisgera
I had a look at the new reference implementation of PEP 246 (Object Adaptation) and I feel uneasy with one specific point of this new version. I don't fully understand why it checks if *the type of* the protocol has a method "__adapt__": ... # (c) then check if protocol.__adapt__ exists

Re: yield_all needed in Python

2005-03-02 Thread Nick Coghlan
Douglas Alan wrote: Steve Holden <[EMAIL PROTECTED]> writes: Guido has generally observed a parsimony about the introduction of features such as the one you suggest into Python, and in particular he is reluctant to add new keywords - even in cases like decorators that cried out for a keyword rathe

how to control a USB DISK?

2005-03-02 Thread zyqnews
hello all, I now have a simple project. It is to test the change of use disk, when a new usb disk is plugged into the usb socket, the program will copy a file to the usb disk, then disabled the usb disk to be pulled out safely. I intend to make it with python. Does someone here get any experience

Re: how to control a USB DISK?

2005-03-02 Thread Ola Natvig
[EMAIL PROTECTED] wrote: hello all, I now have a simple project. It is to test the change of use disk, when a new usb disk is plugged into the usb socket, the program will copy a file to the usb disk, then disabled the usb disk to be pulled out safely. I intend to make it with python. Does someon

Re: Help- Recursion v. Iter Speed comparison

2005-03-02 Thread Roy Smith
actuary77 <[EMAIL PROTECTED]> wrote: > Recurse from time: 4.305942779541 seconds > > Iter from time: 0.009904632568359 seconds > > No comparison, why is recursion so slow? I believe Edouard Manet said it best, "Damn your recursion, Henri. Iteration, however complex, is always

Re: reuse validation logic with descriptors

2005-03-02 Thread David S.
Steve Holden holdenweb.com> writes: > You want assignment to a method-local variable to turn an attribute into > a property? That's programming with a magic wand ... > > That will depend on the value returned by property access, surely? > > I suspect you are a little confused about propertie

Re: Closing dialog window in Tkinter

2005-03-02 Thread Svennglenn
Harlin Seritt wrote: > You can add this: > > button = Button(top, text="Close Me", command=top.destroy) > button.pack() > > That will kill the Toplevel window. > > Cheers, > > Harlin Seritt Thank you, it worked great :) -- http://mail.python.org/mailman/listinfo/python-list

Re: how to control a USB DISK?

2005-03-02 Thread Roland Heiber
Hi, when you're under linux and a 2.6er kernel, take a look at hotplug, you can configure it the way that your script gets executed whenever a specific device is plugged in/out ... HtH, Roland [EMAIL PROTECTED] wrote: when a new usb disk is plugged into the usb socket, the program will copy a fi

Distributing applications

2005-03-02 Thread Phillip Mills
I've learned enough of the Python language to be mildly dangerous and have used it in a few personal projects. All my development of commercial (or production) products over the past dozen years have been done with C++ or Java. For a program I'm planning -- to begin during the summer -- having

Re: yield_all needed in Python

2005-03-02 Thread Steven Bethard
Douglas Alan wrote: Steven Bethard <[EMAIL PROTECTED]> writes: I'm guessing the * syntax is pretty unlikely to win Guido's approval. There have been a number of requests[1][2][3] for syntax like: x, y, *rest = iterable Oh, it is so wrong that Guido objects to the above. Python needs fully des

Stuck on Jythonc --all w/ ZipException PyMethod

2005-03-02 Thread Mitch Amiano
I'm getting started working with Jython (hope this is an ok group for the question), and ran into a stumbling block using the jythonc tool. It is a fairly simple Jython script which uses the Apache Batik SVG library, imports the SVG Canvas, and puts up a simple Swing interface to let the user l

Re: assigning a custom mapping type to __dict__

2005-03-02 Thread Steven Bethard
Nick Coghlan wrote: Steven Bethard wrote: The problem with inheriting from dict is that you then need to override *all* the methods in the dict object, because they all go straight to Python's dict'c C code functions. So just because you redefine __getitem__ doesn't mean you don't still have to

Re: Distributing applications

2005-03-02 Thread Toby Dickenson
On Wednesday 02 March 2005 14:12, Phillip Mills wrote: > now any comments or references on the mechanics of creating > a self-contained distribution? Run to http://starship.python.net/crew/theller/py2exe/ -- Toby Dickenson -- http://mail.python.org/mailman/listinfo/python-list

Re: creating csv file from

2005-03-02 Thread Skip Montanaro
> "Sandeep" == Sandeep Avinash Gohad <[EMAIL PROTECTED]> writes: Sandeep> How can i use the url as an input so that I can save data from Sandeep> that particular webpage to comma seperated file (csv). This worked for me: import urllib, csv reader = csv.reader(urllib.urlopen("

Re: Distributing applications

2005-03-02 Thread Jaime Wyant
I wanted a nice tightly-wrapped distribution of my own and really didn't want to go the py2exe route. I may have used a sledgehammer to kill a fly, but here is what I did... 1) Downloaded python source (2.3.4) 2) Modified source, so that sys.path would pull from a registry key setup by my install

Re: Need some simple coding help

2005-03-02 Thread Steven Bethard
mx2k wrote: indeed, we're it is our combat timeline. we enter the initiative and reaction time, it should find out the lowest then the next, then the 'n'th etc. and shouw it on the screen like Next action 'Character Name1' at tick No 'Initiative1 2nd action 'Character Name2' at tick No 'Initia

Re: any Python equivalent of Math::Polynomial::Solve?

2005-03-02 Thread Cousin Stanley
| In case you are still interested pygsl wraps the GSL solver. | | from pygsl import poly | | pc = poly.poly_complex( 3 ) | | tmp, rs = pc.solve( ( 2 , 3 , 1 ) ) | | print rs | | | You get pygsl at http://sourceforge.net/projects/pygsl/ Pierre I am still interested and have downloa

Re: Need some simple coding help

2005-03-02 Thread Steven Bethard
mx2k wrote: ah, and sorry for that 'unreadable' code, but that was our first try of coding ever. we're working through the python documentaion right now - and - thanks to the post by STeVe we at last now that we have to construct a class for our purpose. Well, you don't *have* to -- it could be don

Re: [Python-Dev] Re: python-dev Summary for 2005-01-16 through 2005-01-31

2005-03-02 Thread Max M
Martin v. Löwis wrote: Steve Holden wrote: The more I participate, the more I can relate to Eric Raymond's notion of a "gift society". Volunteers give their contributions to the community just because they want to, and they may get recognition in return. But because these are gifts, you can just st

Re: creating csv file from

2005-03-02 Thread Premshree Pillai
On Wed, 2 Mar 2005 08:27:35 -0600, Skip Montanaro <[EMAIL PROTECTED]> wrote: > > "Sandeep" == Sandeep Avinash Gohad <[EMAIL PROTECTED]> writes: > > Sandeep> How can i use the url as an input so that I can save data from > Sandeep> that particular webpage to comma seperated file (csv).

Re: Running Python Scripts With 'sudo'

2005-03-02 Thread Steve Holden
Tim Daneliuk wrote: Given that setuid is a Bad Thing for scripts, what is the general consensus here on running a Python script via 'sudo' to give it root system access? Is this reasonably secure, or am I still asking for trouble? TIA, The value of "sudo" is that everyone must authenticate as thems

Re: Stuck on Jythonc --all w/ ZipException PyMethod

2005-03-02 Thread Simon Brunning
On Wed, 02 Mar 2005 14:13:48 GMT, Mitch Amiano <[EMAIL PROTECTED]> wrote: > I'm getting started working with Jython (hope this is an ok group for > the question), and ran into a stumbling block using the jythonc tool. Well, I'm sure that no one is going to object to Jython questions here, but you

Zope - Restrict Acquisition Question

2005-03-02 Thread Jack
I have the following requirement for Zope: I need to use Zope as a web cloning tool. The directory structure is as follows: ->>Core Folder ->>Client 1 ->>Client 2 ... ->>Client n 1] Client 1 and Client 2 need to acquire from the Core Folder. 2] Client 2 must not acquire from Client 1. 3] Client 1

What e-mail list provides the best support for Twisted?

2005-03-02 Thread Andy Leszczynski
Thx, A. -- http://mail.python.org/mailman/listinfo/python-list

rearrange text

2005-03-02 Thread Daniel Skinner
If I have the following text var = '1,2,3,4' and I want to use the comma as a field delimeter and rearrange the fields to read '1,3,2,4' How would I accomplish this in python? -- http://mail.python.org/mailman/listinfo/python-list

Dr. Dobb's Python-URL! - weekly Python news and links (Mar 1)

2005-03-02 Thread Cameron Laird
Editor's note: "Python-URL!" is minimal. It doesn't support advertisements, we never allow the subscribers' addresses to be used for other purposes, we don't claim infallibility, and we even take a couple weeks off some years. Occasionally, though--not as often as the US enters a shooting war, sa

Re: rearrange text

2005-03-02 Thread Roel Schroeven
Daniel Skinner wrote: > If I have the following text > > var = '1,2,3,4' > > and I want to use the comma as a field delimeter and rearrange the > fields to read > > '1,3,2,4' > > How would I accomplish this in python? I take it you want to swap the second and the third element? That can be acc

Re: rearrange text

2005-03-02 Thread Simon Brunning
On 2 Mar 2005 07:36:48 -0800, Daniel Skinner <[EMAIL PROTECTED]> wrote: > If I have the following text > > var = '1,2,3,4' > > and I want to use the comma as a field delimeter That bit's easy: C:\WINNT\system32>python Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on win32

Re: rearrange text

2005-03-02 Thread Daniel Skinner
ah thanks I couldn't figure out how to join it up very appropriately, had this loop ... yeeeaah .. :) Thanks for both comments -- http://mail.python.org/mailman/listinfo/python-list

Re: HELP: Python equivalent of UNIX command "touch"

2005-03-02 Thread pekka niiranen
Roy Smith wrote: pekka niiranen <[EMAIL PROTECTED]> wrote: Does anybody know Python recipe for changing the date of the directory or files in W2K to current date and time? In UNIX shell command "touch" does it. You want os.utime() Nope, it does not work for directories in Windows -- http://mail.p

Re: HELP: Python equivalent of UNIX command "touch"

2005-03-02 Thread Roy Smith
In article <[EMAIL PROTECTED]>, pekka niiranen <[EMAIL PROTECTED]> wrote: >Roy Smith wrote: >> pekka niiranen <[EMAIL PROTECTED]> wrote: >> >>>Does anybody know Python recipe for changing the date >>>of the directory or files in W2K to current date and time? >>>In UNIX shell command "touch" does

[ANN] IPython 0.6.12 is out.

2005-03-02 Thread Fernando Perez
Hi all, I'm glad to announce the release of IPython 0.6.12. This is mainly a bugfix release. IPython's homepage is at: http://ipython.scipy.org and downloads are at: http://ipython.scipy.org/dist I've provided RPMs (for Python 2.3 and 2.4, built under Fedora Core 3), plus source downloads (.

ANNOUNCE: Kamaelia 0.1.1 Released

2005-03-02 Thread Michael Sparks
Kamaelia 0.1.1 has been released! This is the initial release version of Kamaelia. What is it? === Kamaelia is a collection of Axon components designed for network protocol experimentation in a single threaded, select based environment. Axon components are python generators are augmented

Re: Distributing applications

2005-03-02 Thread André Søreng
Phillip Mills wrote: I've learned enough of the Python language to be mildly dangerous and have used it in a few personal projects. All my development of commercial (or production) products over the past dozen years have been done with C++ or Java. For a program I'm planning -- to begin during

Re: any Python equivalent of Math::Polynomial::Solve?

2005-03-02 Thread konrad . hinsen
Carl Banks wrote: > If you don't have a great need for speed, you can accomplish this > easily with the linear algebra module of Numeric/numarray. Suppose > your quintic polynomial's in the form > >a + b*x + c*x**2 + d*x**3 + e*x**4 + x**5 > > The roots of it are equal to the eigenvalues of

Re: Problem in Dictionaries

2005-03-02 Thread Terry Reedy
"Glauco Silva" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I would like to know if the dictionary can sort with a function that i >give to then! No. You have to either make a list of key,value items and sort that, possibly with a cmp or key parameter items = d.items() items.

Re: What's the cost of using hundreds of threads?

2005-03-02 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Przemys³aw Ró¿ycki <[EMAIL PROTECTED]> wrote: >Thanks for your comments on winXP threads implementation. You confirmed >me in conviction that I shouldn't use windows. >Personally I use linux with 2.6.10 kernel, so hopefully I don't have to >share your grief. ;) ?

Re: What's the cost of using hundreds of threads?

2005-03-02 Thread Przemysław Różycki
> In article <[EMAIL PROTECTED]>, > Przemysław Różycki <[EMAIL PROTECTED]> wrote: > >> Thanks for your comments on winXP threads implementation. You confirmed me in conviction that I shouldn't use windows. >> Personally I use linux with 2.6.10 kernel, so hopefully I don't have to share your grie

Re: yield_all needed in Python

2005-03-02 Thread Terry Reedy
"Steven Bethard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Douglas Alan wrote: >> In this case, that is great, since I'd much prefer >> >>yield *gen1(arg) >> >> than >> >>yield_all gen1(arg) > > I'm guessing the * syntax is pretty unlikely to win Guido's approval. > T

Re: possible python/linux/gnome issue!!

2005-03-02 Thread JanC
bruce schreef: > i'm running rh8.0 with gnome.. i'm not sure of the version (it's > whatever rh shipped). > > i've recently updated (or tried to update) python to the latest > version. when i try to run the 'Server Settings/Services' Icon within > gnome, nothing happens... > > i tried to run the

Re: looking for expertise

2005-03-02 Thread klappnase
"Neil Hodgson" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Michael: > > > 5. file operations seem to be delicate; at least I got an error when I > > passed a filename that contains special characters as unicode to > > os.access(), so I guess that whenever I do file operation

Re: Need some simple coding help

2005-03-02 Thread Terry Reedy
"mx2k" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Now you enter a value by which the initiative should be increased, > then adding reaction time to that value and then adding the result to > reaction time. Now soring again by lowest,next,'n'th, etc. and then > again showing th

Re: Identify and perform actions to data within stated limits

2005-03-02 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I found the len(*) obscurely mentioned on someones webpage. *All* the built functions are prominently listed and described in Library Reference 2.1Built-in Functions. I urge you and any beginner to at least read the whole of chapte

Re: Python Online Programming Contest

2005-03-02 Thread Varun
Hi, The results of OPC (online programming contest) is out. The statistics of python usage is available at http://www.samhita.info/opc/status.php. Regards, -OPC Team -- http://mail.python.org/mailman/listinfo/python-list

How would you program this?

2005-03-02 Thread engsol
There is a number puzzle which appears in the daily paper. Because I'm between Python projects, I thought it might be fun to write a program to solve it20 minute job, max. On closer inspection, it became apparent that it's not a simple thing to program. How would you approach it? The puzzle:

Re: Help- Recursion v. Iter Speed comparison

2005-03-02 Thread Kent Johnson
Roy Smith wrote: I believe Edouard Manet said it best, "Damn your recursion, Henri. Iteration, however complex, is always more efficient." (extra points if you can identify the source of that quote). It's not clear what language Manet was talking about when he said that, but it's pretty much a

Re: Distributing applications

2005-03-02 Thread Serge Orlov
Jaime Wyant wrote: > I chose not to use py2exe because it made updating my app a bit > messier. For instance, suppose I don't use the smtplib module in > version 1 of my software. Py2exe realizes that and doesn't 'package' > smtplib with my executable. Now, if I release version 1.1 which does >

Re: How would you program this?

2005-03-02 Thread Russell Blau
"engsol" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > There is a number puzzle which appears in the daily paper. > Because I'm between Python projects, I thought it might be > fun to write a program to solve it20 minute job, max. > > On closer inspection, it became apparent tha

Re: How would you program this?

2005-03-02 Thread James Stroud
> > Rows: > 3 + B + C + D = 22 > E + F + 8 + H = 26 > I + J + K + 8 = 31 > M + 7 + O + P = 25 > > Col sums: > 24, 18, 31, 31 > > Diag sums: > 3 + F + K + P = 24 > M + J + 8 + D = 24 > > > This is a system of 12 variables and 10 equations. Looks like there will be more than one solution (if I rem

Re: Non-blocking input on windows, like select in Unix

2005-03-02 Thread Jonathan Fine
fraca7 wrote: Jonathan Fine a écrit : Paul Rubin wrote: As I recall, some posts to this list say that Windows provides non-blocking i/o for sockets but not for files. No, Windows does provide non-blocking I/O for regular files, but it's a completely different mechanism than the one used by winso

Re: ZoDB's capabilities

2005-03-02 Thread Dieter Maurer
Larry Bates <[EMAIL PROTECTED]> writes on Mon, 28 Feb 2005 18:48:39 -0600: > There is a VERY large website that uses Zope/ZODB that takes up to > 9000 hits per second when it gets busy. ZODB is very fast and > holds up well under load. But, you will not get 9000 hits per second from the ZODB (unl

Re: java crashes in python thread

2005-03-02 Thread Dieter Maurer
Easeway wrote: > I use os.system invoking java VM, when running in python thread, the > java application crashes. Andreas Jung has reported similar behaviour. He suggested that Java 1.4 and the threads of Linux 2.6 do not work reliably together. He tried Java 1.5 and this combination crashes only

Re: What's the cost of using hundreds of threads?

2005-03-02 Thread Aahz
In article <[EMAIL PROTECTED]>, =?ISO-8859-2?Q?Przemys=B3aw_R=F3=BFycki?= <[EMAIL PROTECTED]> wrote: > >I don't spawn them because of computional reasons, but due to the fact >that it makes my code much more simpler. I use built-in tcp features >to achieve loadbalancing - every flow (directed thr

Re: Distributing applications

2005-03-02 Thread Phillip Mills
First, thanks to all the people who have answered so far for the suggestions. In article <[EMAIL PROTECTED]>, André Søreng <[EMAIL PROTECTED]> wrote: > Phillip Mills wrote: > > My problems are: [...] > http://starship.python.net/crew/theller/py2exe/ Apparently I had more problems than I men

Mail System Error - Returned Mail

2005-03-02 Thread imre . adam
The original message was received at Wed, 2 Mar 2005 20:06:59 +0100 from 87.26.243.56 - The following addresses had permanent fatal errors - - Transcript of session follows - ... while talking to python.org.: 554 Service unavailable; [188.60.170.174] blocked using relays.osirusof

Re: Distributing applications

2005-03-02 Thread Jaime Wyant
On 2 Mar 2005 10:43:38 -0800, Serge Orlov <[EMAIL PROTECTED]> wrote: > Jaime Wyant wrote: > > I chose not to use py2exe because it made updating my app a bit > > messier. For instance, suppose I don't use the smtplib module in > > version 1 of my software. Py2exe realizes that and doesn't 'packag

Re: How would you program this?

2005-03-02 Thread Carl Banks
engsol wrote: > There is a number puzzle which appears in the daily paper. > Because I'm between Python projects, I thought it might be > fun to write a program to solve it20 minute job, max. > > On closer inspection, it became apparent that it's not a > simple thing to program. No kidding--i

ANN: PyDev 0.9.1 released

2005-03-02 Thread Fabio Zadrozny
Hi All, PyDev - Python IDE (Python development enviroment for Eclipse) version 0.9.1 has just been released. You can check the homepage (http://pydev.sourceforge.net/) or my blog (http://pydev.blogspot.com/) for more details. -- COMMENTS ON RE

Re: yield_all needed in Python

2005-03-02 Thread Steven Bethard
Terry Reedy wrote: "Steven Bethard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] My suspicion is that if he doesn't like the * syntax when there's a close parallel to the argument parsing usage, he's not likely to like it when there isn't one. Hmm. My impression is that Guido did

Re: ANN: xsdbXML python release with C#/.NET port

2005-03-02 Thread aaronwmail-usenet
Yikes... A couple people pointed out that the upload had no csharp code. That was because sourceforge was uploading the wrong file (but reporting the right filesize). I think it's fixed now (uploaded from paris and minnesota). Sorry!!! --- Aaron Watters -- http://mail.python.org/mailman/l

Re: yield_all needed in Python

2005-03-02 Thread Douglas Alan
Nick Coghlan <[EMAIL PROTECTED]> writes: > If you do write a PEP, try to get genexp syntax supported by the > yield keyword. > That is, the following currently triggers a syntax error: >def f(): > yield x for x in gen1(arg) Wouldn't yield *(x for x in gen1(arg)) be sufficient, and

Re: How would you program this?

2005-03-02 Thread Paul Rubin
"Carl Banks" <[EMAIL PROTECTED]> writes: > No kidding--it's a constrained integer programming problem. Those can > be pretty nasty. This one is pretty simple, being linear with only 12 > unknowns. However, they get very difficult very fast. There are whole > optimization textbooks written on th

Re: How would you program this?

2005-03-02 Thread Bill Mill
On Wed, 02 Mar 2005 10:23:33 -0800, engsol <[EMAIL PROTECTED]> wrote: > There is a number puzzle which appears in the daily paper. > Because I'm between Python projects, I thought it might be > fun to write a program to solve it20 minute job, max. > > On closer inspection, it became apparent t

Re: Distributing applications

2005-03-02 Thread Mitch Amiano
I'm fairly new to python myself (with about 16 years of various languages); I found py2exe fairly straightforward to use. The instructions are ok, but if you care to see it I took some notes and threw them into an article on my company site.

Re: How would you program this?

2005-03-02 Thread Roel Schroeven
Paul Rubin wrote: > "Carl Banks" <[EMAIL PROTECTED]> writes: > >>No kidding--it's a constrained integer programming problem. Those can >>be pretty nasty. This one is pretty simple, being linear with only 12 >>unknowns. However, they get very difficult very fast. There are whole >>optimization

Re: How would you program this?

2005-03-02 Thread Bill Mill
This should have said "time python linalg_brute.py" . I changed the name, but didn't rerun the test. linalg.py is the same as linalg_brute.py. > > 02:42 PM /d/code/Python$ time python linalg.py > 3 3 8 8 > 9 3 8 6 > 9 5 9 8 > 3 7 6 9 > - > 3 3 9 7 > 8 3 8 7 > 9 5 9 8 > 4 7 5 9 > ---

Re: yield_all needed in Python

2005-03-02 Thread Jeremy Bowers
On Wed, 02 Mar 2005 22:54:14 +1000, Nick Coghlan wrote: > Douglas Alan wrote: >> Steve Holden <[EMAIL PROTECTED]> writes: >>>Guido has generally observed a parsimony about the introduction of >>>features such as the one you suggest into Python, and in particular >>>he is reluctant to add new keywo

Re: Distributing applications

2005-03-02 Thread Serge Orlov
Phillip Mills wrote: > First, thanks to all the people who have answered so far for the > suggestions. > > In article <[EMAIL PROTECTED]>, > André Søreng <[EMAIL PROTECTED]> wrote: > > > Phillip Mills wrote: > > > > My problems are: > > [...] > > > http://starship.python.net/crew/theller/py2exe/ >

COM programming with Excel

2005-03-02 Thread Bruce Jewell
I have been accessing Excel data with win32com.  It seems to work well until I get to cells that are formatted for Currency or Accounting.  With these, I get a text string that looks like “(0, 2500)” where the 2500 is actually $25.00, but it cannot be parsed or separated.  Can anyone help m

Re: Faster way to do this...

2005-03-02 Thread Robert Kern
Will McGugan wrote: Warren Postma wrote: Will McGugan wrote: Isn't that equivalent to simply.. nums= range(100) I remember the day I first realized that 900 lines of some C++ program I was working on could be expressed in three lines of python. Ahh. Lately I've found myself commenting C++ code

  1   2   >