Re: What XML lib to use?

2005-09-14 Thread Magnus Lycka
Fredrik Lundh wrote: > since there are no *sane* reasons to use SAX or DOM in Python, that's mainly > a job security issue... I can see two reasons (sane or not): - You're familiar with those APIs and use them in e.g. C++. - You don't want to rely on third party libraries unless you must. In

MAKING MONEY FAST

2005-09-14 Thread davidloeffert
Making easy money fast From: jeff sanford Date: 23 Feb 2004 Time: 20:48:06 Remote Name: 4.13.28.39 Comments Dear Friends: Greetings: I am a retired attorney. A few years ago a man came to me with a letter. He asked me to verify the fact that this was legal to do. I told him I would review it and

Re: Python Search Engine app

2005-09-14 Thread Will McGugan
Alan Meyer wrote: > I'm not aware of such a thing. > > I stand ready to be corrected, but I think Python would not be a > good language for writing search engines. In the ones I've written > for custom projects - in C or PL/1, it has been necessary to > perform very high speed operations on high

Re: Find day of week from month and year

2005-09-14 Thread tryit
Laguna wrote: > Hi Gurus, > > I want to find the expiration date of stock options (3rd Friday of the > month) for an any give month and year. I have tried a few tricks with > the functions provided by the built-in module time, but the problem was > that the 9 element tuple need to be populated cor

Re: Find day of week from month and year

2005-09-14 Thread tryit
Laguna wrote: > Hi Gurus, > > I want to find the expiration date of stock options (3rd Friday of the > month) for an any give month and year. I have tried a few tricks with > the functions provided by the built-in module time, but the problem was > that the 9 element tuple need to be populated corr

Re: Find day of week from month and year

2005-09-14 Thread tryit
>>> import calendar >>> [y[4] for y in calendar.monthcalendar(2005, 9) if y[4]!=0][2] 16 >>> [y[4] for y in calendar.monthcalendar(2003, 6) if y[4]!=0][2] 20 >>> [y[4] for y in calendar.monthcalendar(2006, 2) if y[4]!=0][2] 17 -- http://mail.python.org/mailman/listinfo/python-list

Re: List of integers & L.I.S. (SPOILER)

2005-09-14 Thread Reinhold Birkenfeld
n00m wrote: > Tim Peters wrote: >> The chance that Raymond Hettinger is going to recode _your_ >> functions in C is approximately 0 ;-) > Who is Raymond Hettinger? See python-dev and, wrt this thread, http://docs.python.org/whatsnew/node12.html. Reinhold -- http://mail.python.org/mailman/listin

stdin and py2exe

2005-09-14 Thread Mike Tammerman
Hi, I want create a subprocess using Popen and pipe some input to it. Although everything works perfectly while executing python in, it doesn't work if I try with executables made by py2exe. I think, stdin is invalidated if the program becomes an executable. Because I get a "Bad file descriptor"

Interface with C

2005-09-14 Thread Ben Pearson
I have a program that is developed in C, that has a simple text interface. I would like to use the same program, but with a GUI. I would like to use Python to interface with it, so that Python will simply read and write the code that would be used from a normal user, but using a TK GUI. For exa

Re: List of integers & L.I.S. (SPOILER)

2005-09-14 Thread n00m
Got it! He is a kind of pythonic monsters. Btw, why it's impossible to reply to old threads? Namely, there're no more "Reply" link in them. Only "Reply to author" etc. -- http://mail.python.org/mailman/listinfo/python-list

HELP!! Accessing other machines with an IIS CGI script

2005-09-14 Thread paulp
Greetings, I'm working on a CGI program that will run under MS IIS 5.0 and will browse folders on three other machines, building HTML pages that will provide links to these folders. Essentially, the CGI will connect to each machine in turn, doing the FindFirst/FindNext process based on the curren

working with VERY large 'float' and 'complex' types

2005-09-14 Thread Todd Steury
Greetings Python'ers: I'm just an amature who occasionally uses Python for complex mathematical models. The current model I'm working with occasionally generates really large numbers that are either "float" or "complex" types. These numbers are so large that I either get an overflow error, or s

Re: stdin and py2exe

2005-09-14 Thread Thomas Heller
"Mike Tammerman" <[EMAIL PROTECTED]> writes: > Hi, > > I want create a subprocess using Popen and pipe some input to it. > Although everything works perfectly while executing python in, it > doesn't work if I try with executables made by py2exe. > > I think, stdin is invalidated if the program bec

Re: Python on AIX 4.3.

2005-09-14 Thread David Gutierrez
Alessandro, No, Im not trying to install a posix thread. I was just doing a straight forward installation in AIX 4..3.3. David From: Alessandro Bottoni <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] To: python-list@python.org Subject: Re: Python on AIX 4.3. Date: Wed, 14 Sep 2005 16:32:46 GMT

Re: Software bugs aren't inevitable

2005-09-14 Thread Steven D'Aprano
On Wed, 14 Sep 2005 11:28:02 -0400, Terry Reedy wrote: > > "Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Which works wonderfully as an academic exercise, but doesn't tend to work >> so terribly well in the real world where the performance and >> resource-requ

Re: Django Vs Rails

2005-09-14 Thread Jeff Shell
My opinion, as posted there, was pretty immediate and only going off of surface values. I just saw in Django what I had seen too much of in my own code. I've written similar things in Zope and Formulator that did all sorts of fancy automatic 'admin screen' generation, DBMS CRUD statements. I even a

Re: stdin and py2exe

2005-09-14 Thread Mike Tammerman
Yes, it throws exceptions if I build the exe of the subprogram.py. So, is it possible to pipe some data to another py2exe'd application without a console. Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: improvements for the logging package

2005-09-14 Thread Trent Mick
[EMAIL PROTECTED] wrote] > >> It does, in the "in-development" version of the documentation. Sorry it > >> was not in the 2.4 releases :-( > > Thomas> Maybe it can be backported to 2.4.2 - is there still time for > that? > > Changed now in CVS. When 2.4.2 is released it should be th

Re: Windows Python 2.4: Unbuffered flag causes SyntaxError oninteractive sessions?

2005-09-14 Thread Lonnie Princehouse
After doing some more reading, I now think this isn't a bug. Evidently the unbuffered flag not only makes stdin unbuffered, but it also forces it into binary mode. I didn't realize that when I posted earlier. So the SyntaxErrors arise because the interpreter isn't converting \r\n into \n because

Re: How to make python24.dll smaller ?

2005-09-14 Thread Martin v. Löwis
Stormbringer wrote: > Final result: a 1.1 MB python24.dll which works with my frozen apps and > is not dependent on msvcr71.dll and compressed goes to around 440 KB. > And I'm sure that depending on the project I still could trim some more > modules out. If you are building yourself, anyway, I rec

Re: stdin and py2exe

2005-09-14 Thread Thomas Heller
"Mike Tammerman" <[EMAIL PROTECTED]> writes: > Yes, it throws exceptions if I build the exe of the subprogram.py. > > So, is it possible to pipe some data to another py2exe'd application > without a console. I did this just some days ago. It required a little bit of experimenting. This code exe

Re: Software bugs aren't inevitable

2005-09-14 Thread Steven D'Aprano
On Wed, 14 Sep 2005 14:32:17 +0200, Jerzy Karczmarczuk wrote: > First of all, the recursive version of Fibonacci IS EXPONENTIAL in complexity, > don't say such not-quite-truth as "not quite". Your correction is noted. I had compared the work done with 2**n, but of course any constant greater tha

Re: Python Search Engine app

2005-09-14 Thread Kent Johnson
gene tani wrote: > Yes, there's a bunch. Google for "query parser" + python, "porter > stemming" "stopwords" "text indexer". Maybe lucene has some python > bindings, hmm? At least two Python versions of Lucene: http://pylucene.osafoundation.org/ http://divmod.org/projects/lupy Kent > > Harlin

packaging python for install.

2005-09-14 Thread J
Hi everyone, I have posted a question on this topic before and already received some useful advice. I am basically trying to package python with an App that embedds the interpretor. I am also including numarray (i.e. I have a #include in my C++ code). However it looks like I have problems with

Re: PyGTK or wXPython?

2005-09-14 Thread Jarek Zgoda
Paul McNett napisał(a): >> I would use wx, if it wasn't so dog slow on linux. Qt and GTK are much >> faster, but each one has disadvantages. Finally, you get 3 GUI toolkits, >> of which each claims to be "cross-platform", but each is working at >> acceptable level of WTF only on one system (wx on

Re: Find day of week from month and year

2005-09-14 Thread Terry Reedy
> Laguna wrote: >> I want to find the expiration date of stock options (3rd Friday of the >> month) for an any give month and year. >From year and month (and day=1) get the day of the week (n in [0,6]) of the first of the month using some version of the the standard formula (see below) and look

Re: Windows Python 2.4: Unbuffered flag causes SyntaxError oninteractive sessions?

2005-09-14 Thread Michael Hoffman
Lonnie Princehouse wrote: > Evidently the unbuffered flag not only makes stdin unbuffered, but it > also forces it into binary mode. I didn't realize that when I posted > earlier. > > So the SyntaxErrors arise because the interpreter isn't converting \r\n > into \n because stdin is binary. Not

Re: Interface with C

2005-09-14 Thread Eric Lavigne
> When this button is hit, it will send a code of 0 to the C > program. > > ./mcp | python gui.py Your pipe is backwards. Try this: python gui.py | ./mcp When your gui.py notices that a button got hit, it can just print the number 0 (followed by a newline character) to standard output. This beco

Re: List of integers & L.I.S. (SPOILER)

2005-09-14 Thread Terry Reedy
"n00m" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Who is Raymond Hettinger? The Python developer who, in the last few years, has perhaps been the most active in coding or recoding library modules, such as itertools and sets, in C. He also partipates in development discussio

Re: Windows Python 2.4: Unbuffered flag causes SyntaxError oninteractive sessions?

2005-09-14 Thread Lonnie Princehouse
Yes. With the unbuffered flag, raw_input() strings on my box end in \r. -- http://mail.python.org/mailman/listinfo/python-list

Re: Software bugs aren't inevitable

2005-09-14 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > It is a "mere implementation detail" that (for most computer systems, and > most programming languages) stack space is at a premium and a deeply > recursive function can run out of stack space while the heap still has > lots of free memory. Every serio

Re: Python and SMB, again...

2005-09-14 Thread Atila Olah
Thank you, Larry, I'm figuring out things right now. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and SMB, again...

2005-09-14 Thread Atila Olah
Thank you, Larry, I'm figuring out the things right now. -- http://mail.python.org/mailman/listinfo/python-list

Re: working with VERY large 'float' and 'complex' types

2005-09-14 Thread Paul Rubin
"Todd Steury" <[EMAIL PROTECTED]> writes: > or 1.#INDj. However I really need these numbers to be calculated (although > precision isn't key). Is there a way to get python to increase the size > limit of float and complex numbers? Python just uses machine doubles by default. You might be able

Re: Builtin classes list, set, dict reimplemented via B-trees

2005-09-14 Thread Tim Peters
[EMAIL PROTECTED] > ... > I've gotten bored and went back to one of my other projects: > reimplementing the Python builtin classes list(), set(), dict(), > and frozenset() with balanced trees (specifically, counted B-trees > stored in memory). > > In short, this allows list lookup, insertion, delet

Re: Builtin classes list, set, dict reimplemented via B-trees

2005-09-14 Thread Bryan Olson
[EMAIL PROTECTED] wrote: > Here overhead is compared to a C array of > 1 million PyObject *s. > > Thus, on average, a > 1 million element B-tree uses 25% less memory > than any other balanced data structure which I am aware of, and 50% > more memory than a raw C array. That's overhead of inde

Re: working with VERY large 'float' and 'complex' types

2005-09-14 Thread Fernando Perez
Todd Steury wrote: > Greetings Python'ers: > > I'm just an amature who occasionally uses Python for complex mathematical > models. The current model I'm working with occasionally generates really > large numbers that are either "float" or "complex" types. These numbers are > so large that I eithe

Re: Python Search Engine app

2005-09-14 Thread Alan Meyer
"Alan Meyer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] ... > I stand ready to be corrected, but I think Python would not be a > good language for writing search engines. In the ones I've written > for custom projects - in C or PL/1, it has been necessary to > perform very high

ezPyCrypto

2005-09-14 Thread jlocc
Hi!! I finally decided to use ezPyCrypto for my project but I can't download it from http://www.freenet.org.nz/ezPyCrypto/ ... Does anyone know of a different mirror? Maybe a similar wrapper? My goal is to encrypt a nine-digit number so that it can be safely used as a student ID number. THIS I

Re: HELP!! Accessing other machines with an IIS CGI script

2005-09-14 Thread Roger Upole
Without knowing what operation fails, it's kind of difficult to give any meaningful answers. At what point in the code do you get the error ? If IIS runs under a local account, it might not have permission to access the other machine, or to impersonate a domain user. You might want to set up audi

Re: packaging python for install.

2005-09-14 Thread J
Hi I found the solution to problem and I just want to document it for the next guy. I did not copy the content of the 'dist' directory created by Py2exe to the folder containing my executable. Changing HKEY_LOCAL_MACHINE\SOFTWARE\PythonCore\. alone did not work for me... maybe I should have foun

Re: ezPyCrypto

2005-09-14 Thread [EMAIL PROTECTED]
Why do you want to encrypt just the numbers? -- http://mail.python.org/mailman/listinfo/python-list

Re: ezPyCrypto

2005-09-14 Thread Paul Rubin
[EMAIL PROTECTED] writes: > My goal is to encrypt a nine-digit number so that it can be safely used > as a student ID number. Why don't you just use the build in stdlib functions as other people have proposed? -- http://mail.python.org/mailman/listinfo/python-list

Re: O'Reilly book on Twisted

2005-09-14 Thread Steve M
Does anybody know: Is this book fully up to date with Twisted 2.0? Does the book cover Nevow at all? Does the book cover general programming concepts related to concurrency? I'm reminded of those high quality articles about Deferreds and event programming by one of the Twisted developers? What

Re: List of integers & L.I.S. (SPOILER)

2005-09-14 Thread Reinhold Birkenfeld
n00m wrote: > Got it! He is a kind of pythonic monsters. > > Btw, why it's impossible to reply to old threads? > Namely, there're no more "Reply" link in them. > Only "Reply to author" etc. Perhaps because you are not using a real Usenet client? Reinhold -- http://mail.python.org/mailman/listin

Using multiple threads with pcapy

2005-09-14 Thread billie
Hi all. Because of pcapy sniffng library doesn't permit to listen on multiple interfaces I'm trying to use threads to avoid this problem. In the source below I tried to start a thread for every NIC installed on my system (I got 2 NICs) but once I started the first thread the program can't go fur

Re: ezPyCrypto

2005-09-14 Thread Maciej Dziardziel
[EMAIL PROTECTED] wrote: > Hi!! > > I finally decided to use ezPyCrypto for my project but I can't download > it from http://www.freenet.org.nz/ezPyCrypto/ ... Check this link now, it works for me. -- Maciej "Fiedzia" Dziardziel (fiedzia (at) fiedzia (dot) prv (dot) pl) www.fiedzia.prv.pl Con

Re: improvements for the logging package

2005-09-14 Thread skip
>> Changed now in CVS. When 2.4.2 is released it should be there. Trent> Is this the same kind of thing as the (generally ill-regarded) Trent> change in Python 2.2.x (for some x != 0) that added: No, I just backported the documentation bit that marked the keyword parameter change to

Re: Unexpected Behavior Iterating over a Mutating Object

2005-09-14 Thread Dave Hansen
On Tue, 13 Sep 2005 21:28:21 GMT, [EMAIL PROTECTED] (Dave Hansen) wrote: >OK, first, I don't often have the time to read this group, so >apologies if this is a FAQ, though I couldn't find anything at >python.org. > Thanks to everyone who responded. All is clear now. And I know I need to look de

Event on executable launch

2005-09-14 Thread presentt
Hello, Is there a way to make my Python program do something whenever any executable is launched in Linux? Like, for instance, a class that represents the operating system or something? Thanks a bunch. ~~Ted Present -- http://mail.python.org/mailman/listinfo/python-list

Re: Software bugs aren't inevitable

2005-09-14 Thread Paddy
Hmm, They seem to have reorganised things. As I write, the main article starts here: http://www.spectrum.ieee.org/sep05/2164 With the sidebar here: http://www.spectrum.ieee.org/sep05/2164/extsb1 - Paddy. -- http://mail.python.org/mailman/listinfo/python-list

Re: What XML lib to use?

2005-09-14 Thread Paul Boddie
Fredrik Lundh wrote: > Paul Boddie wrote: [On interoperability] > > For example, PyQt and PyKDE expose various DOMs of the purest > > "non-Pythonic" kind; Mozilla exposes DOMs for XML and HTML > > I didn't see anything about manipulating an application's internal > data structures in the original

Re: Software bugs aren't inevitable

2005-09-14 Thread Paddy
Thanks Giles, I was hoping for a reply from someone close to Praxis like yourself, but, I'm shocked when you said they use Perl as their scripting language of choice, because I thought that with such an emphasis on correctness and maintainability, that it would spill over into other aspects of thei

Re: round() wrong in Python 2.4?

2005-09-14 Thread Robert Kern
Grant Edwards wrote: > On 2005-09-14, Robert Kern <[EMAIL PROTECTED]> wrote: > >>Antoon Pardon wrote: > >>>0.0225 isn't representable and it happens that the actual number >>>you get differ. Now which number python should choose when it is >>>fed 0.0225, I don't know. But expressing the different

Re: some advice about Python GUI apps

2005-09-14 Thread Varghjärta
I'm not sure but wouldn't the simplest(perhaps) solution be to store a reference to all the dialogs you open up in a mapped array of some kind (dictionary) and whenever you are going to open up a dialog you check if it already exists a key matching whatever id you choose. If it exists then use the

Re: What XML lib to use?

2005-09-14 Thread Fredrik Lundh
Paul Boddie wrote: >> For stand-alone XML manipulation in Python, my point still stands: >> programs using DOM and SAX are more bloated and slower than >> the alternatives. > > Your point was that "there are no *sane* reasons to use SAX or DOM in > Python", which actually isn't true. I replied in

Example Script to parse web page links and extract data?

2005-09-14 Thread livin
I'm hoping someone knows of an example script I can see to help me build mine. I'm looking for an easy way to automate the below web site browsing and pull the data I'm searching for. Here's steps it needs to accomplish... 1) login to the site (windows dialog when hitting web page) *optional*

strptime() doesn't recognize BST as a valid timezone

2005-09-14 Thread Adam Monsen
I'm unable to parse the following date string using time.strptime(): "Wed Sep 14, 2005 5:07 PM BST" Format: "%a %b %d, %Y %I:%M %p %Z" I tried changing the locale and using time.tzset(), but no luck. Is there anyone in London (or some other BST location) that would try running the following code?

Re: Removing duplicates from a list

2005-09-14 Thread przemek drochomirecki
> I've a list with duplicate members and I need to make each entry > unique. > > I've come up with two ways of doing it and I'd like some input on what > would be considered more pythonic (or at least best practice). > > Method 1 (the traditional approach) > > for x in mylist: > if mylist.count

Re: Interface with C

2005-09-14 Thread Terry Hancock
On Wednesday 14 September 2005 12:34 pm, Ben Pearson wrote: > I have a program that is developed in C, that has a simple text > interface. I would like to use the same program, but with a GUI. I > would like to use Python to interface with it, so that Python will > simply read and write the code

Re: Magic Optimisation

2005-09-14 Thread Terry Reedy
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Terry - > > If setting up a try-block is as fast (or "takes as long") as one > iteration loop, then wont putting a try-block inside a loop double the > execution time? It will double (more or less) the loop overhead. T

Re: Example Script to parse web page links and extract data?

2005-09-14 Thread Steven Bethard
livin wrote: > I'm looking for an easy way to automate the below web site browsing and pull > the data I'm searching for. This is a task that BeautifulSoup[1] is usually good for. > 4) After search, table shows many links (hundreds sometimes) to the actual > data I need. > Links are this fo

Re: What XML lib to use?

2005-09-14 Thread Robert Kern
Fredrik Lundh wrote: > Paul Boddie wrote: > >>>For stand-alone XML manipulation in Python, my point still stands: >>>programs using DOM and SAX are more bloated and slower than >>>the alternatives. >> >>Your point was that "there are no *sane* reasons to use SAX or DOM in >>Python", which actually

Re: Unexpected Behavior Iterating over a Mutating Object

2005-09-14 Thread Bengt Richter
On Wed, 14 Sep 2005 11:12:14 +0200, bruno modulix <[EMAIL PROTECTED]> wrote: >Dave Hansen wrote: >(snip code snippets and sensible explanations) > >> Again, iterating over an item that is mutating seems like a Bad >> Idea(tm) to me. > >It as *always* been a bad idea to modify a list in place (I

Re: Removing duplicates from a list

2005-09-14 Thread tcc . chapman
This works too, if speed isn't your thing.. >> a = [ 1,2,3,2,6,1,3,4,1,7,5,6,7] >> a = dict( ( (i,None) for i in a)).keys() a [1, 2, 3, 4, 5, 6, 7] -- http://mail.python.org/mailman/listinfo/python-list

Re: Software bugs aren't inevitable

2005-09-14 Thread Terry Hancock
On Wednesday 14 September 2005 02:23 pm, Paul Rubin wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: > > It is a "mere implementation detail" that (for most computer systems, and > > most programming languages) stack space is at a premium and a deeply > > recursive function can run out of stack

Re: working with VERY large 'float' and 'complex' types

2005-09-14 Thread Terry Hancock
> "Todd Steury" <[EMAIL PROTECTED]> writes: > > or 1.#INDj. However I really need these numbers to be calculated (although > > precision isn't key). Is there a way to get python to increase the size > > limit of float and complex numbers? This is really a natural problem with such calculations.

Re: global interpreter lock

2005-09-14 Thread Michael Sparks
Paul Rubin wrote: ... > I don't see how generators substitute for microthreads. In your example > from another post: I've done some digging and found what you mean by microthreads - specifically I suspect you're referring to the microthreads package for stackless? (I tend to view an activated gen

Re: Removing duplicates from a list

2005-09-14 Thread Steven Bethard
przemek drochomirecki wrote: > def unique(s): > e = {} > for x in s: > if not e.has_key(x): >e[x] = 1 > return e.keys() This is basically identical in functionality to the code: def unique(s): return list(set(s)) And with the new-and-improved C implementation of sets comin

Re: global interpreter lock

2005-09-14 Thread Michael Sparks
arrgh... hit wrong keystroke which caused an early send before I'd finished typing... (skip the message I'm replying to hear for a minute please :-) Michael. -- http://mail.python.org/mailman/listinfo/python-list

urllib.open problem

2005-09-14 Thread Astan Chee
Hi Guys, I have a python script which runs perfectly on my machine. However a machine that I tested it on gives the following error message: Traceback (most recent call last): File "whip.py", line 616, in OnRebootRunning File "whip.py", line 626, in RebootCustom File

Some advice on startingout with python.

2005-09-14 Thread Laszlo Antal
Hi, Which book(s) would you recommend for me to start learning Python programming?? I am interested mostly to do GUI apps. I want to replace my PHP-GTK programms, and of course learn a lot of Python. Here are some titles I find and got the best reviews:: -Practical Python by Magnus Lie Hetland;

Re: Writing at the beginning of a file

2005-09-14 Thread Bengt Richter
On 14 Sep 2005 07:13:50 -0700, "Thierry Lam" <[EMAIL PROTECTED]> wrote: >Let's say I already wrote a file and have the following: > >testing >testing testing >testing testing testing > >Is there an easy way to write something of variable length at the top >of the file? > >For example, > >6 testing

Re: Software bugs aren't inevitable

2005-09-14 Thread Terry Reedy
"Rocco Moretti" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > The algorithm one uses sometimes depends quite heavily on which mindset > you're using. Some algorithms require much more mental effort to > understand when in their recursive form versus the iterative form, and > vice

Re: global interpreter lock

2005-09-14 Thread Michael Sparks
[ Second time lucky... ] Paul Rubin wrote: ... > I don't see how generators substitute for microthreads. In your example > from another post: I've done some digging and found what you mean by microthreads - specifically I suspect you're referring to the microthreads package for stackless? (I tend

Re: Writing at the beginning of a file

2005-09-14 Thread Terry Reedy
"Thierry Lam" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Is there an easy way to write something of variable length at the top > of the file? ... > The other way to do what I want is to write the whole thing to a new > file, but I want to skip that method if there's an alternat

Property and "fset" in Python 2.4

2005-09-14 Thread Rob Pawsner
With this setup -- PythonWin 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32. -- I'm seeing the old bug which made "fset" methods unusable with declared properties of a class. Even worse, this is happening with a fourth-generation descendent of the Object class, not

Re: Some advice on startingout with python.

2005-09-14 Thread Rune Strand
It's not about GUI, but it's a good book. It's both online and printed: http://diveIntoPython.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP Proposal: Codetags

2005-09-14 Thread David Goodger
Also, please update the Post-History header, adding the date(s) you posted the PEP to the mailing lists and/or newsgroups. And this time I'll remember to attach the file :-) -- David Goodger PEP: XXX Title: Codetags Version: $Revision$ Last-Modified: $Date$ Author: Mi

Re: O'Reilly book on Twisted

2005-09-14 Thread Dave Cook
On 2005-09-14, Steve M <[EMAIL PROTECTED]> wrote: > Is this book fully up to date with Twisted 2.0? Yes, according to an email from the author on the twisted-python mailing list > Does the book cover Nevow at all? Doesn't look like it. More info here: http://fettig.net/weblog/2005/06/30/my-b

Re: Find day of week from month and year

2005-09-14 Thread John Machin
Terry Reedy wrote: >>Laguna wrote: >> >>>I want to find the expiration date of stock options (3rd Friday of the >>>month) for an any give month and year. > > >>From year and month (and day=1) get the day of the week (n in [0,6]) of the > first of the month using some version of the the standard

Re: help in simplification of code [string manipulation]

2005-09-14 Thread John
But ur previous solution worked on my machine... although a friend tried it on his machine and the libraries were not found even if they existed! (Even the -lm was not found) Can you explain a bit why the previous solution worked? Thanks for ur help, --j -- http://mail.python.org/mailman/listi

Re: Python Search Engine app

2005-09-14 Thread Peter Hansen
Will McGugan wrote: > Alan Meyer wrote: >> I stand ready to be corrected, but I think Python would not be a >> good language for writing search engines. > Wasn't Google's first search engine actualy written in Python? Not unless it was some kind of quickie prototype that was immediately discard

Re: global interpreter lock

2005-09-14 Thread Stephen Thorne
On 15/09/05, Michael Sparks <[EMAIL PROTECTED]> wrote: > At the moment, one option that springs to mind is this: > yield WaitDataAvailable("inbox") Twisted supports this. help("twisted.internet.defer.waitForDeferred") example usage is: @deferredGenerator def thingummy(): thing = waitForDe

"optimizing out" getattr

2005-09-14 Thread Daishi Harada
Hi, I'd like to get the 'get2' function below to perform like the 'get1' function (I've included timeit.py results). I'm not sure how to write 'mkget' to do achieve this, however, except to use 'exec' - is that what would be necessary? Thanks in advance, d --- class A: a = 1 b = 2 a = A

Newbie - instanciating classes from other files

2005-09-14 Thread comanighttrain
Hey guys, i just started learning python (i usually use java/C). this has got me stumped as its not mentioned in the documentation (unless im skimming it every time). How does one instanciate a class from another file i thought it would be ---code-

Re: python-dev Summary for 2005-08-01 through 2005-08-15

2005-09-14 Thread Steven Bethard
Steve Tregidgo wrote: > on 2005-08-30 01:45 Tony Meyer said the following: > >> [The HTML version of this Summary is available at >> http://www.python.org/dev/summary/2005-08-01_2005-08-15.html] > ... >> Many revision control systems were extensively discussed, including >> `Subversion`_ (SVN), `P

Re: "optimizing out" getattr

2005-09-14 Thread Stephen Thorne
On 14 Sep 2005 19:46:44 -0700, Daishi Harada <[EMAIL PROTECTED]> wrote: > Hi, > > I'd like to get the 'get2' function below to > perform like the 'get1' function (I've included > timeit.py results). Do you have profiling results that show that a significant percentage of your programs time is be

pyNMS

2005-09-14 Thread Mohammed Smadi
hi anybody used pyNMS b4? I compiled it and seem to be able to import modules but cannot use em, or more like cannot call them since if i do something like: import ping ping.ttl(..) i get an error like Traceback (most recent call last): File "", line 1, in ? AttributeError: 'module' object ha

Re: Newbie - instanciating classes from other files

2005-09-14 Thread Jorge Godoy
[EMAIL PROTECTED] writes: > Hey guys, i just started learning python (i usually use java/C). > > this has got me stumped as its not mentioned in the documentation > (unless im skimming it every time). > > How does one instanciate a class from another file > > i thought it would be > ---

Re: Newbie - instanciating classes from other files

2005-09-14 Thread Devan L
[EMAIL PROTECTED] wrote: > Hey guys, i just started learning python (i usually use java/C). > > this has got me stumped as its not mentioned in the documentation > (unless im skimming it every time). > > How does one instanciate a class from another file import somefile foo = somefile.class(__ini

Re: Software bugs aren't inevitable

2005-09-14 Thread Terry Reedy
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Wed, 14 Sep 2005 11:28:02 -0400, Terry Reedy wrote: > But in the context of my response, I was replying to a paraphrased quote > from somebody who apparently believes that recursion is *always* better > than itera

Re: Property and "fset" in Python 2.4

2005-09-14 Thread Bengt Richter
On Wed, 14 Sep 2005 18:12:44 -0700, "Rob Pawsner" <[EMAIL PROTECTED]> wrote: >With this setup -- > >PythonWin 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] >on win32. > >-- I'm seeing the old bug which made "fset" methods unusable with declared >properties of a class. Even w

Re: urllib.open problem

2005-09-14 Thread Astan Chee
yeah, I actually typed that by hand, the url is a local intranet thus I dont specify any proxies of any kind (which I assume isnt required). Sorry about the typo. Cheers Dennis Lee Bieber wrote: On Thu, 15 Sep 2005 09:19:53 +1000, Astan Chee <[EMAIL PROTECTED]> declaimed the following in co

Re: Software bugs aren't inevitable

2005-09-14 Thread Terry Reedy
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Wed, 14 Sep 2005 14:32:17 +0200, Jerzy Karczmarczuk wrote: >> Here you are a recursive version linear in n; it >> returns the two last Fibonacci numbers of the sequence The minor problem is that for n = 0, there a

Weekly Python Patch/Bug Summary

2005-09-14 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 343 open ( +1) / 2927 closed ( +4) / 3270 total ( +5) Bugs: 908 open ( +0) / 5245 closed (+13) / 6153 total (+13) RFE : 189 open ( +1) / 185 closed ( +0) / 374 total ( +1) New / Reopened Patches __ Allow to

Re: Create and display an email

2005-09-14 Thread Gregory Piñero
I looked into this same question many months ago and got stuck just where you are.  Indeed the webbrowser.open('mailto:...') command seems like a great idea, but I lost 6 hours of my life trying to figure out how to do attachments :-(  Here's my guess at what your two best options are: 1. Work wit

Re: round() wrong in Python 2.4?

2005-09-14 Thread Reinhold Birkenfeld
Robert Kern wrote: > Grant Edwards wrote: >> On 2005-09-14, Robert Kern <[EMAIL PROTECTED]> wrote: >> >>>Antoon Pardon wrote: >> 0.0225 isn't representable and it happens that the actual number you get differ. Now which number python should choose when it is fed 0.0225, I don't know.

Re: round() wrong in Python 2.4?

2005-09-14 Thread Robert Kern
Reinhold Birkenfeld wrote: > Robert Kern wrote: >>Antoon: >>"Python 2.3 isn't rounding 0.0225 up while pyton 2.4 rounds it down." > > Written in Pseudocode: > > not (Py2.3 rounding up and Py2.4 rounding down) I presumed the "isn't" was a typo given the "while." -- Robert Kern [EMAIL PROTECTED

Re: "week-year" conversion to date

2005-09-14 Thread oyvgi
Thanks! Both solutions worked perfectly. -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   >