ANNOUNCE: Kiwi 1.9.1

2005-09-04 Thread Johan Dahlin
Kiwi is a PyGTK framework for building graphical applications loosely based on MVC Model-View-Controller (MVC) and Allen Holub's Visual proxy [1]. Think of Kiwi as a high-level, object-oriented layer built on PyGTK. Its design is based on real-world experience using PyGTK to develop large

ANN: unicode 0.4.8

2005-09-04 Thread garabik-news-2005-05
unicode is a simple python command line utility that displays properties for a given unicode character, or searches unicode database for a given name. It was written with Linux in mind, but should work almost everywhere (including MS Windows and MacOSX), UTF-8 console is recommended. Changes

ANNOUNCE: PyGTK 2.8.0

2005-09-04 Thread Johan Dahlin
I am pleased to announce version 2.8.0 of the Python bindings for GTK. The new release is available from ftp.gnome.org as and its mirrors as soon as its synced correctly: http://ftp.gnome.org/pub/GNOME/sources/pygtk/2.8/pygtk-2.8.0.tar.gz Major changes: Improved GObject/Python

Re: how to do this?

2005-09-04 Thread Peter Otten
Justin Straube wrote: As the user enters or removes characters into/from sEnt I would like for set_info() to set infVar with the correct value. The same as how IDLE shows the line and column in the lower right corner. Code Example from time import localtime from Tkinter import *

Re: Problems with Python for Windows extensions

2005-09-04 Thread vincent wehren
KK [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] | the code below is taken from M$ technet as an example on using vb | script to do a replace all in word: | | Const wdReplaceAll = 2 | | Set objWord = CreateObject(Word.Application) | objWord.Visible = True | | Set objDoc = |

discarded iterator.next() at interactive global scope doesn't bump interator??

2005-09-04 Thread Bengt Richter
Is this a well known bug that's been fixed? I couldn't find any discussion of it, but maybe my googling's off today ;-/ def foo(): ... it = iter(range(10)) ... while True: ... i = it.next() ... print i ... if i3==0: ... print 'skipping next'

Re: Sockets: code works locally but fails over LAN

2005-09-04 Thread Bryan Olson
n00m wrote: Bryan; Look at how I corrected your the very first version (see added arguments in both functions). And now it really can handle multiple connections! Ah, yes, I see. (In my defense, I had already fixed that bug in my second version.) -- --Bryan --

Re: discarded iterator.next() at interactive global scope doesn't bump interator??

2005-09-04 Thread Peter Otten
Bengt Richter wrote: [it.next() appears to be a noop in the interactive interpreter] I guess it could be in the read-eval-print loop Indeed: for i in range(5): ... 42 ... 42 42 42 42 42 Whereas: for i in range(5): ... None Every line with an expression that doesn't evaluate to

Re: OpenSource documentation problems

2005-09-04 Thread Paul Rubin
Steve Holden [EMAIL PROTECTED] writes: legitimate. Python's core developers are in a leadership position for Python whether they like it or not; and users and volunteers absorb the attitudes of the leaders. So, what you are saying is because the developers (I explain in another post on

Code for generating validation codes (in images)

2005-09-04 Thread morphex
Hi, does anyone of you know of some code I can use to generate validation code images? Those images you can see on various login forms used to prevent bots for performing a brute-force attack.. Thanks, Morten -- http://mail.python.org/mailman/listinfo/python-list

Re: Code for generating validation codes (in images)

2005-09-04 Thread Paul Rubin
morphex [EMAIL PROTECTED] writes: does anyone of you know of some code I can use to generate validation code images? Those images you can see on various login forms used to prevent bots for performing a brute-force attack.. http://en.wikipedia.org/wiki/CAPTCHA --

Re: Code for generating validation codes (in images)

2005-09-04 Thread Giuseppe di Sabato (aka deelan)
morphex wrote: Hi, does anyone of you know of some code I can use to generate validation code images? Those images you can see on various login forms used to prevent bots for performing a brute-force attack.. take a look at the pycaptcha package: http://freshmeat.net/projects/pycaptcha/

Re: Code for generating validation codes (in images)

2005-09-04 Thread morphex
Great, thanks to you both. :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Proposal: add sys to __builtins__

2005-09-04 Thread Xiao Jianfeng
Paul Watson wrote: This sounds pretty interesting. How about a switch to invoke this handling for the one-liner crowd and those who wish to use it? Somehow, I never heard any C programmers suggest that the default processing not include the need for: #include stdio.h I think it is

Re: Command config, quitting, binary, Timer

2005-09-04 Thread Diez B. Roggisch
! import Tkinter ! def dogo(): ! while 1: ! b.config(command=lambda:None) ! root = Tkinter.Tk() ! b = Tkinter.Button(root, text=Go, command=dogo) ! b.pack() ! root.mainloop() I guess tkinter has to keep a name-reference pair (some days a discussion about this arose and /F

Re: os.system(rls) prints to screen??

2005-09-04 Thread Xah Lee
Steve Holden wrote: This is all pretty basic stuff. Perhaps you should stop your verbal assault on the computer science community and start to learn the principles of what you are doing. is this a supressed behavior that a human animal can finally instinctively and justifiably release at

documentation error

2005-09-04 Thread bill
From 3.2 in the Reference Manual The Standard Type Hierarchy: Integers These represent elements from the mathematical set of whole numbers. The generally recognized definition of a 'whole number' is zero and the positive integers. That is to say, -1 is not a whole number. The documentation

Re: discarded iterator.next() at interactive global scope doesn't bump interator??

2005-09-04 Thread Bengt Richter
On Sun, 04 Sep 2005 10:10:33 +0200, Peter Otten [EMAIL PROTECTED] wrote: Bengt Richter wrote: [it.next() appears to be a noop in the interactive interpreter] I guess it could be in the read-eval-print loop Indeed: for i in range(5): ... 42 ... 42 42 42 42 42 Whereas: for i in

Re: Proposal: add sys to __builtins__

2005-09-04 Thread Colin J. Williams
Rick Wotnaz wrote: Michael Hoffman [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: What would people think about adding sys to __builtins__ so that import sys is no longer necessary? This is something I must add to every script I write that's not a one-liner since they have this idiom at

Re: 'isa' keyword

2005-09-04 Thread Colin J. Williams
Rocco Moretti wrote: Terry Hancock wrote: On Thursday 01 September 2005 07:28 am, Fuzzyman wrote: What's the difference between this and ``isinstance`` ? I must confess that an isa operator sounds like it would have been slightly nicer syntax than the isinstance() built-in function. But

Re: documentation error

2005-09-04 Thread tiissa
bill wrote: From 3.2 in the Reference Manual The Standard Type Hierarchy: Integers These represent elements from the mathematical set of whole numbers. The generally recognized definition of a 'whole number' is zero and the positive integers. This term is ambiguous as it seems to be

ANN: SIP v4.3 Released

2005-09-04 Thread Phil Thompson
Riverbank Computing is pleased to announce the release of SIP v4.3 available from http://www.riverbankcomputing.co.uk/sip/. SIP is a tool for generating Python modules that wrap C or C++ libraries. It is similar to SWIG. It is used to generate PyQt and PyKDE. Full documentation is available

Replacing large number of substrings

2005-09-04 Thread Will McGugan
Hi, Is there a simple way of replacing a large number of substrings in a string? I was hoping that str.replace could take a dictionary and use it to replace the occurrences of the keys with the dict values, but that doesnt seem to be the case. To clarify, something along these lines..

Re: Sockets: code works locally but fails over LAN

2005-09-04 Thread n00m
Bryan Olson wrote: Ah, yes, I see. (In my defense, I had already fixed that bug in my second version.) 1. Yes! I myself noticed that, but your 2nd version looks a bit more verbose. 2. This all means... what? ONLY send() vs sendall() matters? Sometimes send() really sends ALL and my version works

sizeof(long) from python

2005-09-04 Thread John
I want to know the sizeof(long) / sizeof(int) ... in C from python. (This is to read a set of numbers output from a C Code and can be machine dependent). Is there an easy way except writing a C program and parsing its output? Thanks, --j -- http://mail.python.org/mailman/listinfo/python-list

ANN: PyQt v3.15 Released

2005-09-04 Thread Phil Thompson
Riverbank Computing is pleased to announce the release of PyQt v3.14 available from http://www.riverbankcomputing.co.uk/pyqt/. Changes since the last release include: - improved integration between Qt's ActiveQt framework and Python's win32com modules - support for QScintilla v1.6 - support

Re: sizeof(long) from python

2005-09-04 Thread Simon Percivall
Take a look at the struct module (http://docs.python.org/lib/module-struct.html), it does what you want. -- http://mail.python.org/mailman/listinfo/python-list

Re: os.system(rls) prints to screen??

2005-09-04 Thread Steve Holden
Xah Lee wrote: Steve Holden wrote: This is all pretty basic stuff. Perhaps you should stop your verbal assault on the computer science community and start to learn the principles of what you are doing. is this a supressed behavior that a human animal can finally instinctively and

Re: sizeof(long) from python

2005-09-04 Thread John
Thanks a lot, That solved my problem. --j -- http://mail.python.org/mailman/listinfo/python-list

DrPython debugger

2005-09-04 Thread Pandiani
Hello, I've been experimenting with different Python IDEs since I started to learn Python. I must say that WingIDE is the best I tried, but unfortunately it's not free and that 10 minutes use is killing me. So I decide to write my Python programs in DrPython which was recommended by vegaseat.

Re: Command config, quitting, binary, Timer

2005-09-04 Thread bearophileHUGS
Witn your suggestions and with some tests and work I've solved most of the problems, thank you all for the comments. Peter Hansen: What did you expect to happen with the infinite loop inside dogo()? I expected that the same memory used by the b.config(command=...) can be used by the successive

Re: Replacing large number of substrings

2005-09-04 Thread tiissa
Will McGugan wrote: Hi, Is there a simple way of replacing a large number of substrings in a string? I was hoping that str.replace could take a dictionary and use it to replace the occurrences of the keys with the dict values, but that doesnt seem to be the case. You can look at the

Re: Replacing large number of substrings

2005-09-04 Thread Robert Kern
Will McGugan wrote: Hi, Is there a simple way of replacing a large number of substrings in a string? I was hoping that str.replace could take a dictionary and use it to replace the occurrences of the keys with the dict values, but that doesnt seem to be the case. To clarify, something

Re: Problems with Python for Windows extensions

2005-09-04 Thread KK
thx for ur reply u r rite that i should use a raw string, but that doesn't solve the problem i am q annoyed by this strange behaviour. i tried to run the script on my friend's pc, which is python2.4 + pywin 204 + office 2000, but same thing happened now i am thinking to generate a vbs from python

regular expression unicode character class trouble

2005-09-04 Thread Diez B. Roggisch
Hi, I need in a unicode-environment the character-class set(\w) - set([0-9]) or aplha w/o num. Any ideas how to create that? And what performance implications do I have to fear? I mean I guess that the characterclasses aren't implementet as sets, but as comparison-function that compares a

Re: os.system(rls) prints to screen??

2005-09-04 Thread Xah Lee
do you know what the Muses do when a mortal challenged them? And, please tell me exactly what capacity you hold under the official Python organization so that i can calculate to what degree i can kiss your ass or feign mum of your ignorance. Xah [EMAIL PROTECTED] ∑ http://xahlee.org/ Steve

String from File - List without parsing

2005-09-04 Thread Gregor Horvath
Hi, given the dynamic nature of python I assume that there is an elegant solution for my problem, but I did not manage to find it. I have a file that contains for example on line: ['147', '148', '146'] when I read the file f = file(I050901.ids).readlines() I have a string f[0] == ['147',

Re: Binary Trees in Python

2005-09-04 Thread Jorgen Grahn
On Sun, 21 Aug 2005 08:52:10 -0400, François Pinard [EMAIL PROTECTED] wrote: [Jorgen Grahn] Neither C++ nor Python has tree structures in their standard libraries. I assume that's because there is no single interface that is proven to suit everybody's needs. It is already easy writing tree

Re: Problems with Python for Windows extensions

2005-09-04 Thread Kartic
Hi, Invoking Execute as shown below works.. I have no explanation why your VB to Py converted code did not work. wdFindContinue = 1 objSelection.Find.Execute('Contosa', False, True, False, False, True, True, wdFindContinue, True, 'Fabrikam', wdReplaceAll, False, False, False, False) This

Re: Managing events

2005-09-04 Thread cantabile
Thanks to you all for these answers. I'll try these ideas and post back comments and results. -- http://mail.python.org/mailman/listinfo/python-list

dual processor

2005-09-04 Thread John Brawley
Greetings, all. I have a program I'm trying to speed up by putting it on a new machine. The new machine is a Compaq W6000 2.0 GHz workstation with dual XEON processors. I've gained about 7x speed over my old machine, which was a 300 MHz AMD K6II, but I think there ought to be an even greater speed

Re: dual processor

2005-09-04 Thread Paul Rubin
John Brawley [EMAIL PROTECTED] writes: However, the thought occurs that Python (2.4.1) may not have the ability to take advantage of the dual processors, so my question: Does it? No. If not, who knows where there might be info from people trying to make Python run 64-bit, on multiple

Re: String from File - List without parsing

2005-09-04 Thread Jean-François Doyon
Gregor, You want to use eval(): Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. eval('[3,54,5]') [3, 54, 5] Cheers, J.F. Gregor Horvath wrote: Hi, given the dynamic nature of python I assume

Re: documentation error

2005-09-04 Thread Reinhold Birkenfeld
tiissa wrote: bill wrote: From 3.2 in the Reference Manual The Standard Type Hierarchy: Integers These represent elements from the mathematical set of whole numbers. The generally recognized definition of a 'whole number' is zero and the positive integers. This term is ambiguous

Re: regular expression unicode character class trouble

2005-09-04 Thread Steven Bethard
Diez B. Roggisch wrote: Hi, I need in a unicode-environment the character-class set(\w) - set([0-9]) or aplha w/o num. Any ideas how to create that? I'd use something like r[^_\d\W], that is, all things that are neither underscores, digits or non-alphas. In action: py

Re: Considering moving from PowerBuilder to Python

2005-09-04 Thread Norm Goertzen
Wolfgang Keller wrote: But I also really would like to find something very close to Sybase's patented datawindow technology -- it's a real time-saver. BTW: As most readers (including me) probably don't know Powerbuilder: What is a Datawindow? Some kind of data-aware GUI widget?

How to integrate an array?

2005-09-04 Thread Tom Kaz
I need to compute integral of some array function, something like: from scipy import * f = lambda x: array( [sin(x),cos(x)] ) integrate.quad(f, 0, 1) Unfortunately integrate.quad requires Float type. Any ideas how to perform this? Thanks, T.Kaz. --

is dict.copy() a deep copy or a shallow copy

2005-09-04 Thread Alex
Entering the following in the Python shell yields help(dict.copy) Help on method_descriptor: copy(...) D.copy() - a shallow copy of D Ok, I thought a dictionary copy is a shallow copy. Not knowing exactly what that meant I went to http://en.wikipedia.org/wiki/Deep_copy where I could read

Assigning 'nochage' to a variable.

2005-09-04 Thread [EMAIL PROTECTED]
Has anyone else felt a desire for a 'nochange' value resembling the 'Z'-state of a electronic tri-state output? var1 = 17 var1 = func1() # func1() returns 'nochange' this time print var1 # prints 17 It would be equivalent to: var1 = 17 var2, bool1 = func1() if bool1: var1 =

Re: dual processor

2005-09-04 Thread Jeremy Jones
John Brawley wrote: Greetings, all. I have a program I'm trying to speed up by putting it on a new machine. The new machine is a Compaq W6000 2.0 GHz workstation with dual XEON processors. I've gained about 7x speed over my old machine, which was a 300 MHz AMD K6II, but I think there ought to be

Re: documentation error

2005-09-04 Thread Bryan Olson
Reinhold Birkenfeld wrote: tiissa wrote: bill wrote: From 3.2 in the Reference Manual The Standard Type Hierarchy: Integers These represent elements from the mathematical set of whole numbers. The generally recognized definition of a 'whole number' is zero and the positive

Re: How to integrate an array?

2005-09-04 Thread Robert Kern
Tom Kaz wrote: I need to compute integral of some array function, something like: from scipy import * f = lambda x: array( [sin(x),cos(x)] ) integrate.quad(f, 0, 1) Unfortunately integrate.quad requires Float type. Any ideas how to perform this? Do each function separately. The

Re: dual processor

2005-09-04 Thread Paul Rubin
Jeremy Jones [EMAIL PROTECTED] writes: to pass data around between processes. Or an idea I've been tinkering with lately is to use a BSD DB between processes as a queue just like Queue.Queue in the standard library does between threads. Or you could use Pyro between processes. Or CORBA. I

Re: dual processor

2005-09-04 Thread Jeremy Jones
Paul Rubin wrote: Jeremy Jones [EMAIL PROTECTED] writes: to pass data around between processes. Or an idea I've been tinkering with lately is to use a BSD DB between processes as a queue just like Queue.Queue in the standard library does between threads. Or you could use Pyro between

Re: documentation error

2005-09-04 Thread Bengt Richter
On Sun, 04 Sep 2005 20:02:10 GMT, Bryan Olson [EMAIL PROTECTED] wrote: Reinhold Birkenfeld wrote: tiissa wrote: bill wrote: From 3.2 in the Reference Manual The Standard Type Hierarchy: Integers These represent elements from the mathematical set of whole numbers. The generally

Possible improvement to slice opperations.

2005-09-04 Thread Ron Adam
After considering several alternatives and trying out a few ideas with a modified list object Bengt Richter posted, (Thank You), I think I've found a way to make slice operation (especially far end indexing) symmetrical and more consistent. So to find out if this is indeed a possibility, it

Re: How to integrate an array?

2005-09-04 Thread Tom Kaz
Do each function separately. The routine that scipy.integrate.quad uses adapts to the local conditions of the function (when the function is flat, it uses fewer samples; when steep, more). It's not so easy to do it separately. I want to integrate function that includes linalg.expm - as you

Re: is dict.copy() a deep copy or a shallow copy

2005-09-04 Thread Max Erickson
Alex [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: D={'Python': 'good', 'Basic': 'simple'} E=D.copy() E {'Python': 'good', 'Basic': 'simple'} D['Basic']='oh my' D {'Python': 'good', 'Basic': 'oh my'} E {'Python': 'good', 'Basic': 'simple'} Hmm, this looks like a deep copy to

Re: How to integrate an array?

2005-09-04 Thread Robert Kern
Tom Kaz wrote: [I wrote:] (please attribute quotes) Do each function separately. The routine that scipy.integrate.quad uses adapts to the local conditions of the function (when the function is flat, it uses fewer samples; when steep, more). It's not so easy to do it separately. I want to

Controlling memory allocation

2005-09-04 Thread cwoolf
Let's say I have an OS that can't limit the amount of memory a process is allowed to consume, but I want to run some Python code in a simulated low memory environment... Is there a way to tell Python to limit the size of it's heap? Can you ask it to use a function other than malloc through the C

GETTING IMAGEDATA FROM A BUTTON

2005-09-04 Thread pythonprogrammer
Does anyone know how to get pixeldata from the image of a button without taking a screenshot? -- http://mail.python.org/mailman/listinfo/python-list

GETTING IMAGEDATA FROM A BUTTON

2005-09-04 Thread pythonprogrammer
Does anyone know how to get pixeldata from the image of a button without taking a screenshot? -- http://mail.python.org/mailman/listinfo/python-list

Re: String from File - List without parsing

2005-09-04 Thread John Machin
Gregor Horvath wrote: Hi, given the dynamic nature of python I assume that there is an elegant solution for my problem, but I did not manage to find it. I have a file that contains for example on line: ['147', '148', '146'] when I read the file f = file(I050901.ids).readlines() Y3K

Re: Replacing large number of substrings

2005-09-04 Thread Michael J. Fromberger
In article [EMAIL PROTECTED], Will McGugan [EMAIL PROTECTED] wrote: Hi, Is there a simple way of replacing a large number of substrings in a string? I was hoping that str.replace could take a dictionary and use it to replace the occurrences of the keys with the dict values, but that

RE: GETTING IMAGEDATA FROM A BUTTON

2005-09-04 Thread Delaney, Timothy (Tim)
pythonprogrammer wrote: Does anyone know how to get pixeldata from the image of a button without taking a screenshot? Yes. http://www.catb.org/~esr/faqs/smart-questions.html Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: Assigning 'nochage' to a variable.

2005-09-04 Thread Terry Reedy
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Has anyone else felt a desire for a 'nochange' value No. resembling the 'Z'-state of a electronic tri-state output? Not familiar with that. var1 = 17 var1 = func1() # func1() returns 'nochange' this time

Python Doc Problem Example: os.system

2005-09-04 Thread Xah Lee
Python Doc Problem Example: os.system Xah Lee, 2005-09 today i'm trying to use Python to call shell commands. e.g. in Perl something like output=qx(ls) in Python i quickly located the the function due to its well-named-ness: import os os.system(ls) however, according to the doc

Re: Possible improvement to slice opperations.

2005-09-04 Thread Terry Reedy
Ron Adam [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Slicing is one of the best features of Python in my opinion, but when you try to use negative index's and or negative step increments it can be tricky and lead to unexpected results. This topic has come up fairly often on

Re: Proposal: add sys to __builtins__

2005-09-04 Thread Terry Reedy
Colin J. Williams [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Rick Wotnaz wrote: +1 here. As far as I'm concerned, both os and sys could be special- cased that way. That said, I would guess the likelihood of that happening is 0. +1 for both. Some people might prefer that

Re: OpenSource documentation problems

2005-09-04 Thread Aahz
In article [EMAIL PROTECTED], Steve Holden [EMAIL PROTECTED] wrote: Bear in mind that the PSF made its very first grants last year. The reason none of those grants was awarded to a documentation project was that the (volunteer) Grants Committee and helpers didn't see any documentation

Re: Python Doc Problem Example: os.system

2005-09-04 Thread Jeremy Jones
Xah Lee wrote: Python Doc Problem Example: os.system Xah Lee, 2005-09 today i'm trying to use Python to call shell commands. e.g. in Perl something like output=qx(ls) in Python i quickly located the the function due to its well-named-ness: import os os.system(ls) however, according to the

learning python

2005-09-04 Thread placid
Hi all, I was just wondering about good books that teach python (either with programming or no programming experience at all) ? Or some online tutorial? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: learning python

2005-09-04 Thread Christopher Culver
placid [EMAIL PROTECTED] writes: I was just wondering about good books that teach python (either with programming or no programming experience at all) ? Or some online tutorial? Did you even bother doing a web search? Learn Python or Python tutorial would be enough. Christopher --

Re: documentation error

2005-09-04 Thread Bryan Olson
Bengt Richter wrote: Bryan Olson wrote: Consider deleting the sentence in which the Python doc tries to define mathematical integers. This is a nice site: http://mathworld.wolfram.com/WholeNumber.html http://mathworld.wolfram.com/topics/Integers.html So maybe: Integers

Re: OpenSource documentation problems

2005-09-04 Thread Steve Holden
Aahz wrote: In article [EMAIL PROTECTED], Steve Holden [EMAIL PROTECTED] wrote: Bear in mind that the PSF made its very first grants last year. The reason none of those grants was awarded to a documentation project was that the (volunteer) Grants Committee and helpers didn't see any

Re: learning python

2005-09-04 Thread placid
Christopher Culver wrote: placid [EMAIL PROTECTED] writes: I was just wondering about good books that teach python (either with programming or no programming experience at all) ? Or some online tutorial? Did you even bother doing a web search? Learn Python or Python tutorial would be

Re: learning python

2005-09-04 Thread Benji York
placid wrote: Christopher Culver wrote: placid [EMAIL PROTECTED] writes: I was just wondering about good books that teach python (either with programming or no programming experience at all) ? Or some online tutorial? Did you even bother doing a web search? Learn Python or Python tutorial would

Magic Optimisation

2005-09-04 Thread simonwittber
Hello People. I've have a very tight inner loop (in a game app, so every millisecond counts) which I have optimised below: def loop(self): self_pool = self.pool self_call_exit_funcs = self.call_exit_funcs self_pool_popleft = self.pool.popleft self_pool_append

Re: Possible improvement to slice opperations.

2005-09-04 Thread Patrick Maupin
After considering several alternatives and trying out a few ideas with a modified list object Bengt Richter posted, (Thank You), I think I've found a way to make slice operation (especially far end indexing) symmetrical and more consistent. I don't know that it makes it more consistent. I

Re: Magic Optimisation

2005-09-04 Thread Paul McGuire
This isn't much prettier, but what if you extract the try-except overhead out from the while loop? You only expect the exception to fire one time, at the end of the list. You can also eliminate any localization of variables for calls that are not called in the loop, such as self_pool (which does

Re: Magic Optimisation

2005-09-04 Thread Paul Rubin
[EMAIL PROTECTED] writes: However, it is very ugly. Does anyone have any tips on how I could get this optimisation to occor magically, via a decorator perhaps? Have you tried psyco? -- http://mail.python.org/mailman/listinfo/python-list

Re: dual processor

2005-09-04 Thread William Park
John Brawley [EMAIL PROTECTED] wrote: Greetings, all. I have a program I'm trying to speed up by putting it on a new machine. The new machine is a Compaq W6000 2.0 GHz workstation with dual XEON processors. I've gained about 7x speed over my old machine, which was a 300 MHz AMD K6II, but I

RE: Magic Optimisation

2005-09-04 Thread Delaney, Timothy (Tim)
[EMAIL PROTECTED] wrote: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/277940 For an even bigger improvement (in general), look at psyco: http://psyco.sourceforge.net/. Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: Magic Optimisation

2005-09-04 Thread simonwittber
I guess it is hard to see what the code is doing without a complete example. The StopIteration is actually raised by task.next(), at which point task is removed from the list of generators (self.pool). So the StopIteration can be raised at any time. The specific optimisation I am after, which

Re: Magic Optimisation

2005-09-04 Thread simonwittber
Yes. It slows down the loop when there are only a few iterators in the pool, and speeds it up when there are 2000. My use case involves 1000 iterators, so psyco is not much help. It doesn't solve the magic creation of locals from instance vars either. Sw. --

mod_python: what's going on here?

2005-09-04 Thread Robert J. Hansen
I'm not entirely certain comp.lang.python is the proper newsgroup for mod_python questions, but comp.lang.python.web doesn't seem to exist, so... my apologies in advance if this is considered off-topic. I'm attempting to get mod_python 3.1.4/python 2.4.1 working on Apache 2.0.54 running under OS

Re: Magic Optimisation

2005-09-04 Thread Paul Rubin
[EMAIL PROTECTED] writes: My use case involves 1000 iterators, so psyco is not much help. It doesn't solve the magic creation of locals from instance vars either. How about using __slots__ to put those instance vars at fixed offsets in the pool object (self then needs to be a new-style class

Re: Possible improvement to slice opperations.

2005-09-04 Thread Ron Adam
Terry Reedy wrote: Ron Adam [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Slicing is one of the best features of Python in my opinion, but when you try to use negative index's and or negative step increments it can be tricky and lead to unexpected results. This topic has come up

Re: String from File - List without parsing

2005-09-04 Thread Gregor Horvath
John Machin wrote: f = file(I050901.ids).readlines() Y3K bug alert :-) but then there is Python 3000 and Hurd, which solves all problems of this universe :-) Something like this: def munch(astrg): ...return [x[1:-1] for x in astrg.rstrip(\n)[1:-1].split(, )] Thanks! (1) You

Re: Proposal: add sys to __builtins__

2005-09-04 Thread Rick Wotnaz
Terry Reedy [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: Colin J. Williams [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Rick Wotnaz wrote: +1 here. As far as I'm concerned, both os and sys could be special- cased that way. That said, I would guess the likelihood of

Re: learning python

2005-09-04 Thread placid
Benji York wrote: placid wrote: Christopher Culver wrote: placid [EMAIL PROTECTED] writes: I was just wondering about good books that teach python (either with programming or no programming experience at all) ? Or some online tutorial? Did you even bother doing a web search? Learn

Re: Possible improvement to slice opperations.

2005-09-04 Thread Ron Adam
Patrick Maupin wrote: After considering several alternatives and trying out a few ideas with a modified list object Bengt Richter posted, (Thank You), I think I've found a way to make slice operation (especially far end indexing) symmetrical and more consistent. I don't know that it makes

Re: Magic Optimisation

2005-09-04 Thread simonwittber
def loop(self): self_pool = self.pool self_call_exit_funcs = self.call_exit_funcs self_pool_popleft = self.pool.popleft self_pool_append = self.pool.append check = self.pool.__len__ while check() 0: task = self_pool_popleft()

use mod_python' session and redirect

2005-09-04 Thread wafd Alex
hi all when i use Session object to save a object and then i use util.redirect(req,url) to redirect a .psp.But in my psp i cann't load session so i cann't get object from session,help me,thanks here is my code .py s=Session.Session(req) s[cur_user]=user

Re: Magic Optimisation

2005-09-04 Thread simonwittber
Psyco actually slowed down the code dramatically. I've fixed up the code (replaced the erroneous return statement) and uploaded the code for people to examine: The test code is here: http://metaplay.dyndns.org:82/~xerian/fibres.txt These are the run times (in seconds) of the test file. without

[ python-Bugs-999042 ] Compiler module doesn't handle global statement correctly

2005-09-04 Thread SourceForge.net
Bugs item #999042, was opened at 2004-07-27 22:15 Message generated for change (Settings changed) made by nascheme You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=999042group_id=5470 Please note that this message will contain a full copy of the comment

[ python-Bugs-1200686 ] SyntaxError raised on win32 for correct files

2005-09-04 Thread SourceForge.net
Bugs item #1200686, was opened at 2005-05-12 10:19 Message generated for change (Comment added) made by tim_one You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1200686group_id=5470 Please note that this message will contain a full copy of the comment