Re: A critic of Guido's blog on Python's lambda

2006-05-11 Thread Michele Simionato
jayessay wrote: > I was saying that you are mistaken in that pep-0343 could be used to > implement dynamically scoped variables. That stands. Proof by counter example: from __future__ import with_statement import threading special = threading.local() def getvar(name): return getattr(specia

Re: Multi-line lambda proposal.

2006-05-11 Thread [EMAIL PROTECTED]
this is how I think it should be done with multi-line lambdas: def arg_range(inf, sup, f): return lambda(arg): if inf <= arg <= sup: return f(arg) else: raise ValueError and instead of @arg_range(5, 17) def f(arg): return arg*2 you do: f = arg_range(5, 17, lambda(arg)):

Re: How to encode html and xml tag datas with standard python modules ?

2006-05-11 Thread DurumDara
Hi ! I probed this function, but that is not encode the hungarian specific characters, like áéíóüóöőúüű: so the chars above chr(127). Have the python a function that can encode these chars too, like in Zope ? Thanx for help: dd Fredrik Lundh írta: > DurumDara wrote: > > >> Have the python s

Re: Nested loops confusion

2006-05-11 Thread Matthew Graham
Thanks very much for the advice, have tidied it up and tested and seems to be working as needed. I'm still not sure what was stopping the inner loop from working earlier - but removing the redundancy in "j=0" and so on seems to have solved it. Matt Dennis Lee Bieber wrote: > If that wor

Re: 2 books for me

2006-05-11 Thread bruno at modulix
Gary Wessle wrote: > Hi > > I am about to order 2 books, and thought I should talk to you first. > I am getting Python Cookbook by Alex Martelli, David Ascher, Anna > Martelli Ravenscroft, Anna Martelli Ravenscroft, since Bruce Eckel's > Thinking in Python is not finished and didn't have any new r

Re: Use subprocesses in simple way...

2006-05-11 Thread DurumDara
10 May 2006 04:57:17 -0700, Serge Orlov <[EMAIL PROTECTED]>: > I thought md5 algorithm is pretty light, so you'll be I/O-bound, then > why bother with multi-processor algorithm? This is an assessor utility. The program's architecture must be flexible, because I don't know, where it need to run (on

Re: Memory leak in Python

2006-05-11 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: > Sure, are there any available simulators...since i am modifying some > stuff i thought of creating one of my own. But if you know some > exisiting simlators , those can be of great help to me. Don't know any by name, but I'm sure you can find some on Google

Re: Multi-line lambda proposal.

2006-05-11 Thread Duncan Booth
[EMAIL PROTECTED] wrote: > this is how I think it should be done with multi-line lambdas: > > def arg_range(inf, sup, f): > return lambda(arg): > if inf <= arg <= sup: > return f(arg) > else: > raise ValueError > > and instead of > @arg_range(5, 17) > def f(arg): > return

Re: A critic of Guido's blog on Python's lambda

2006-05-11 Thread Petr Prikryl
"Chris Uppal" wrote: > Petr Prikryl wrote: > > > for element in aCollection: > > if element > 0: > > return True > > return False > > [I'm not sure whether this is supposed to be an example of some specific > language (Python ?) or just a generic illustr

Re: Calling C/C++ functions in a python script

2006-05-11 Thread chaosquant
Ravi Teja a écrit : > > For more advanced needs, take a look at some of the extending options > available. > http://www.suttoncourtenay.org.uk/duncan/accu/integratingpython.html Thanks for your answer. It is just what I'm trying to do. Unfortunately, apparently I need a "pyhton24_d.lib" to link

Re: PIL thumbnails unreasonably large

2006-05-11 Thread Almad
Thank You! That helped. Somehow obvious when you pointed out, but...*phew*. Almad -- http://mail.python.org/mailman/listinfo/python-list

Re: A critic of Guido's blog on Python's lambda

2006-05-11 Thread Thomas F. Burdick
Ken Tilton <[EMAIL PROTECTED]> writes: > David C. Ullrich wrote: > > > But duh, if that's how things are then we can't have transitive > > dependencies working out right; surely we > > want to be able to have B depend on A and then C > > depend on B... > > (And also if A and B are allowed to depen

releasing interpreter lock in custom code?

2006-05-11 Thread Bram Stolk
Hello, I've implemented, in C, a function that does a lot of I/O, and thus can block for a long time. If I execute this function in my Python script, it does not relinquish the global interpreter lock, like Python's native blocking functions do, like I/O funcs, and time.sleep() func. How can I

Re: Nested loops confusion

2006-05-11 Thread John Machin
On 11/05/2006 5:59 PM, Matthew Graham wrote: > Thanks very much for the advice, have tidied it up and tested and seems > to be working as needed. Seems to be working? Consider where you have the expression x^2 + y^2 ... I'd like to bet that you mean "x squared" etc, not "x exclusive-or 2" etc.

Re: Multi-line lambda proposal.

2006-05-11 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: > this is how I think it should be done with multi-line lambdas: > > def arg_range(inf, sup, f): > return lambda(arg): > if inf <= arg <= sup: > return f(arg) > else: > raise ValueError This is going to be fun to debug if anything goes w

Re: Memory leak in Python

2006-05-11 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > Sure, are there any available simulators...since i am modifying some > stuff i thought of creating one of my own. But if you know some > exisiting simlators , those can be of great help to me. http://simpy.sourceforge.net/ -- http://mail.python.org/mailman/listinfo/pyth

Re: reusing parts of a string in RE matches?

2006-05-11 Thread Mirco Wahab
Hi mpeters42 & John > With a more complex pattern (like 'a.a': match any character between > two 'a' characters) this will get the length, but not what character is > between the a's. Lets take this as a starting point for another example that comes to mind. You have a string of characters inters

Python memory deallocate

2006-05-11 Thread mariano . difelice
Hi, I've a big memory problem with my application. First, an example: If I write: a = range(500*1024) I see that python process allocate approximately 80Mb of memory. What can i do for DEALLOCATE this memory, or good part of this? My really problem is that my program work with more photos, whi

Install libraries only without the program itself

2006-05-11 Thread Gregor Horvath
Hi, My application is a client/server in a LAN. I want to keep my programs .py files on a central File Server serving all clients. The clients should load those over the LAN every time they start the program since I expect that they are rapidly changing and I dont want to update each client sepera

Re: releasing interpreter lock in custom code?

2006-05-11 Thread Sion Arrowsmith
Bram Stolk <[EMAIL PROTECTED]> wrote: >I've implemented, in C, a function that does a lot of I/O, and thus >can block for a long time. > >If I execute this function in my Python script, it does not >relinquish the global interpreter lock, like Python's native >blocking functions do, like I/O func

Re: unittest: How to fail if environment does not allow execution?

2006-05-11 Thread Kai Grossjohann
Roy Smith wrote: > Kai Grossjohann <[EMAIL PROTECTED]> wrote: >> I wrote a test case that depends on a certain file existing in the >> environment. > > In theory, unit tests should not depend on any external factors, but > we all know the difference between theory and practice, right? :-) I am

Re: Matplotlib in Python vs. Matlab, which one has much better graphical pressentation?

2006-05-11 Thread DeepBlue
anyone? N/A wrote: > Hi all, > > Can I have your opinions on Matlab vs. Matplotlib in Python in terms of > 2D and 3D graphical presentation please. > > Matplotlib in Python vs. Matlab, which one has much better graphical > pressentation? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python memory deallocate

2006-05-11 Thread Tim N. van der Leeuw
Hi, 'del a' should remove 'a', as a reference to the tuple created by the 'range' function. If that is also the last reference, it can now be garbage-collected. Of course, the question is if you really need to allocate such a big amount of memory. If you just need to iterate over some numbers, it

Re: unittest: How to fail if environment does not allow execution?

2006-05-11 Thread Kent Johnson
Kai Grossjohann wrote: > I wrote a test case that depends on a certain file existing in the > environment. So, I guess I should test that the file exists in the > setUp method. But what if it doesn't exist? How do I fail in that case? > > I would like to emit an error message explaining what is

Re: Python editor recommendation.

2006-05-11 Thread Nikolai Hlubek
Thomas Guettler wrote: > Am Tue, 09 May 2006 14:37:53 +0100 schrieb Dale Strickland-Clark: > > >>Vim. >>Everything else is Notepad. > > > Vi or vim are good for editing config files over ssh. For programming > I use XEmacs. Smelling napalm here. If you don't want to use vim you should give er

Re: unittest: How to fail if environment does not allow execution?

2006-05-11 Thread Roy Smith
Kai Grossjohann <[EMAIL PROTECTED]> wrote: > I am trying to figure out whether a message is logged by syslog. > Not sure how I would do that except require the user to configure syslog > to log foo messages to the /var/log/foo file and to then check that > the message is written. Well, I suppose t

pythoncode in matlab

2006-05-11 Thread Sven Jerzembeck
Hello guys, is there any possibiliy using Phython code in Matlab. I couldnt find any helpful stuff. Its not graphical stuff I am doing just calculations with arrays and strings. Thanks for answering in advance Sven -- http://mail.python.org/mailman/listinfo/python-list

Re: Python memory deallocate

2006-05-11 Thread Eric.zhao.82
O I see -- http://mail.python.org/mailman/listinfo/python-list

Re: Python editor recommendation.

2006-05-11 Thread Philippe Martin
Looking at their flash demo made me want to try it, but after all dependencies installed, I get "Fatal Python error: can't initialise module gtksourceview Aborted (core dumped)" Is it stable ? Philippe mystilleef wrote: > The powerful no-nonsense, no-frills, no-hassle, no-fuzz editor, > S

Re: Python editor recommendation.

2006-05-11 Thread Eric.zhao.82
HI I use VIM in FreeBSD or M$'s Windows -- http://mail.python.org/mailman/listinfo/python-list

Re: Python memory deallocate

2006-05-11 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hi, > I've a big memory problem with my application. > > First, an example: > > If I write: > > a = range(500*1024) > > I see that python process allocate approximately 80Mb of memory. > What can i do for DEALLOCATE this memory, or good part of this? > > My really p

redirecting print to a a file

2006-05-11 Thread AndyL
Hi, Can I redirect print output, so it is send to a file, not stdout. I have a large program and would like to avoid touching hundreds of print's. Thx, Andy -- http://mail.python.org/mailman/listinfo/python-list

Re: redirecting print to a a file

2006-05-11 Thread Harold Fellermann
>>> import sys >>> sys.stdout = file("output","w") >>> print "here you go" -- http://mail.python.org/mailman/listinfo/python-list

python equivalent of the following program

2006-05-11 Thread AndyL
Hi, What would by a python equivalent of following shell program: #!/bin/sh prog1 > file1 & prog2 > file2 & As you see, I need to spawn a few processes and redirect stdout to some files. Thx, A. -- http://mail.python.org/mailman/listinfo/python-list

Re: redirecting print to a a file

2006-05-11 Thread AndyL
Harold Fellermann wrote: import sys sys.stdout = file("output","w") print "here you go" > > And what if I want to still send the output to stdout and just a log it in the file as well? A. -- http://mail.python.org/mailman/listinfo/python-list

Re: redirecting print to a a file

2006-05-11 Thread Sybren Stuvel
AndyL enlightened us with: > Can I redirect print output, so it is send to a file, not stdout. Change sys.stdout to a file object. > I have a large program and would like to avoid touching hundreds of > print's. I can suggest using the logging module instead of print. It's much more flexible tha

Re: redirecting print to a a file

2006-05-11 Thread AndyL
Sybren Stuvel wrote: >>I have a large program and would like to avoid touching hundreds of >>print's. > > > I can suggest using the logging module instead of print. It's much > more flexible than prints, and well suited for large programs. > Thx for the hint. I will look into that. A. -- http

Re: releasing interpreter lock in custom code?

2006-05-11 Thread Andrew MacIntyre
Bram Stolk wrote: > I've implemented, in C, a function that does a lot of I/O, and thus > can block for a long time. > > If I execute this function in my Python script, it does not > relinquish the global interpreter lock, like Python's native > blocking functions do, like I/O funcs, and time.sl

Re: redirecting print to a a file

2006-05-11 Thread Sybren Stuvel
AndyL enlightened us with: > And what if I want to still send the output to stdout and just a log > it in the file as well? $ python some_program.py | tee output.log Or write a class that has a write() function and outputs to a file and to the original value of sys.stdout (IIRC that's in sys.__st

Re: redirecting print to a a file

2006-05-11 Thread AndyL
Sybren Stuvel wrote: > AndyL enlightened us with: > >>And what if I want to still send the output to stdout and just a log >>it in the file as well? > > > $ python some_program.py | tee output.log > > Or write a class that has a write() function and outputs to a file and > to the original value

Re: Python memory deallocate

2006-05-11 Thread mariano . difelice
Well, it's right about range diff xrange, ok, but this was a simple example... I repeat that my program don't work with range or xrange... I MUST find a system which deallocate memory... Otherwise, my application crashes not hardly it's arrived to break-point system -- http://mail.python.org/ma

Re: Python memory deallocate

2006-05-11 Thread Sion Arrowsmith
<[EMAIL PROTECTED]> wrote: >If I write: > >a = range(500*1024) > >I see that python process allocate approximately 80Mb of memory. >What can i do for DEALLOCATE this memory, or good part of this? > [ ... ] >I've tried with Destroy, del command, but the memory don't show down. It won't (much). Whe

Re: Python editor recommendation.

2006-05-11 Thread Laurent Pointal
Dale Strickland-Clark a écrit : > Vim. > > Everything else is Notepad. ++, yes Notepad++ !!! (windows only) See http://notepad-plus.sourceforge.net/uk/site.htm :-) > > DeepBlue wrote: > >> Hi all, >> >> Can any one please recommend me an editor for coding Python. Thank u. >> I have Komodo (

Re: redirecting print to a a file

2006-05-11 Thread Mirco Wahab
AndyL wrote: >> $ python some_program.py | tee output.log > Thx again. Python is cool, do that in C++ or Java :-) Yes, thats obviously true ;-) $> javac someprogram.java; $> java someprogram | tee output.log $> g++ someother.cpp -o someother $> ./someother | tee output.log SCNR, Mirco -- http

Re: Install libraries only without the program itself

2006-05-11 Thread Serge Orlov
Gregor Horvath wrote: > Hi, > > My application is a client/server in a LAN. I want to keep my programs > .py files on a central File Server serving all clients. The clients > should load those over the LAN every time they start the program since I > expect that they are rapidly changing and I dont

scientific libraries for python

2006-05-11 Thread Harold Fellermann
Hi all, I want to use the current need for a Levenberg-Marquardt least squares fitting procedure for my long term desire to dive into scientific libraries for python. However, I am always confused by the shear sheer variety of available packages and the fact that some of them (Numeric, Numarray) s

Re: Python memory deallocate

2006-05-11 Thread mariano . difelice
Ok, this is true. Well, you consider that my app has a first windows, where I choose, for example, the application 1. The application 1 will be started, and it will allocate 200Mb total. Now I want to abort this operation, and i will return to main initial window. The memory usage remain to 200Mb

Re: Python memory deallocate

2006-05-11 Thread Heiko Wundram
Am Donnerstag 11 Mai 2006 15:15 schrieb [EMAIL PROTECTED]: > I MUST find a system which deallocate memory... > Otherwise, my application crashes not hardly it's arrived to > break-point system As was said before: as long as you keep a reference to an object, the object's storage _will not be_ re

String concatenation performance

2006-05-11 Thread Cristian.Codorean
I was just reading a "Python Speed/Performance Tips" article on the Python wiki http://wiki.python.org/moin/PythonSpeed/PerformanceTips and I got to the part that talks about string concatenation and that it is faster when using join instead of += because of strings being immutable. So I have trie

_PyList_Extend advice

2006-05-11 Thread Robin Becker
Is there some reason why list.extend is not documented in the C Api? I see an exported function called _PyList_Extend which seems to be the right thing, but is it deprecated? -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

ANN: Leo 4.4 Final released

2006-05-11 Thread Edward K. Ream
Leo 4.4 Final is now available at: http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106 Leo is a text editor, data organizer, project manager and much more. See: http://webpages.charter.net/edreamleo/intro.html The highlights of Leo 4.4: -- - An Emac

Re: Python memory deallocate

2006-05-11 Thread Serge Orlov
Heiko Wundram wrote: > Am Donnerstag 11 Mai 2006 15:15 schrieb [EMAIL PROTECTED]: > > I MUST find a system which deallocate memory... > > Otherwise, my application crashes not hardly it's arrived to > > break-point system > > As was said before: as long as you keep a reference to an object, the ob

Re: Python memory deallocate

2006-05-11 Thread bruno at modulix
[EMAIL PROTECTED] wrote: > Ok, this is true. > > Well, you consider that my app has a first windows, where I choose, for > example, the application 1. > The application 1 will be started, and it will allocate 200Mb total. > Now I want to abort this operation, and i will return to main initial > w

Re: reusing parts of a string in RE matches?

2006-05-11 Thread John Salerno
Mirco Wahab wrote: > Py: > import re > tx = 'a1a2a3A4a35a6b7b8c9c' > rg = r'(\w)(?=(.\1))' > print re.findall(rg, tx) The only problem seems to be (and I ran into this with my original example too) that what gets returned by this code isn't exactly what you are looking for, i.e. the num

Re: reusing parts of a string in RE matches?

2006-05-11 Thread John Salerno
Ben Cartwright wrote: > Yes, and no extra for loops are needed! You can define groups inside > the lookahead assertion: > > >>> import re > >>> re.findall(r'(?=(aba))', 'abababababababab') > ['aba', 'aba', 'aba', 'aba', 'aba', 'aba', 'aba'] Wow, that was like magic! :) -- http://mail.pyt

Re: Memory leak in Python

2006-05-11 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > I ran simulation for 128 nodes and used the following > > oo = gc.get_objects() > print len(oo) > > on every time step the number of objects are increasing. For 128 nodes > I had 1058177 objects. > > I think I need to revisit the code and remove the referencesbut how

Re: String concatenation performance

2006-05-11 Thread Duncan Booth
Cristian.Codorean wrote: > I was just reading a "Python Speed/Performance Tips" article on the > Python wiki > http://wiki.python.org/moin/PythonSpeed/PerformanceTips > and I got to the part that talks about string concatenation and that > it is faster when using join instead of += because of stri

Re: python equivalent of the following program

2006-05-11 Thread blue99
AndyL wrote: > Hi, > > What would by a python equivalent of following shell program: > > #!/bin/sh > > prog1 > file1 & > prog2 > file2 & > > > As you see, I need to spawn a few processes and redirect stdout to some > files. For example : --cut here--

Re: Use subprocesses in simple way...

2006-05-11 Thread Serge Orlov
DurumDara wrote: > 10 May 2006 04:57:17 -0700, Serge Orlov <[EMAIL PROTECTED]>: > > I thought md5 algorithm is pretty light, so you'll be I/O-bound, then > > why bother with multi-processor algorithm? > > This is an assessor utility. > The program's architecture must be flexible, because I don't kn

Re: How to encode html and xml tag datas with standard python modules ?

2006-05-11 Thread Serge Orlov
DurumDara wrote: > Hi ! > > I probed this function, but that is not encode the hungarian specific > characters, like áéíóüóöoúüu: so the chars above chr(127). > Have the python a function that can encode these chars too, like in Zope ? > The word encode is ambiguous. What do you mean? The example

Re: Python memory deallocate

2006-05-11 Thread mardif
In python 2.5 this was resolved, ok, but i can't use any python version then 2.3.5. This project was initializated with this version, and now it can be dangerous change version, even because I use McMillan installer for compile e build an executable. So, my initial window is a "menu window", when

Re: reusing parts of a string in RE matches?

2006-05-11 Thread Mirco Wahab
Hi John > rg = r'(\w)(?=(.)\1)' > > That would at least isolate the number, although you'd still have to get > it out of the list/tuple. I have no idea how to do this in Python in a terse way - but I'll try ;-) In Perl, its easy. Here, the "match construct" (\w)(?=(.)\1) returns all captures in

which windows python to use?

2006-05-11 Thread Brian Blais
Hello, Are there any recommendations for which Windows python version to use? I'd like to see a pros-and-cons description of each, given that different uses might dictate different versions. The versions I know (and there are surely more) are: 1) download from www.python.org 2) enthought 3)

find all index positions

2006-05-11 Thread micklee74
hi say i have string like this astring = 'abcd efgd 1234 fsdf gfds abcde 1234' if i want to find which postion is 1234, how can i achieve this...? i want to use index() but it only give me the first occurence. I want to know the positions of both "1234" thanks -- http://mail.python.org/mailman/li

Re: Python memory deallocate

2006-05-11 Thread Diez B. Roggisch
mardif wrote: > In python 2.5 this was resolved, ok, but i can't use any python version > then 2.3.5. > This project was initializated with this version, and now it can be > dangerous change version, even because I use McMillan installer for > compile e build an executable. > > So, my initial win

NEWBIE: Tokenize command output

2006-05-11 Thread Lorenzo Thurman
This is what I have so far: // #!/usr/bin/python import os cmd = 'ntpq -p' output = os.popen(cmd).read() // The output is saved in the variable 'output'. What I need to do next is select the line from that output that starts with the '*' remote refid st t when poll reach

Re: String concatenation performance

2006-05-11 Thread Ben Sizer
Cristian.Codorean wrote: > I was just reading a "Python Speed/Performance Tips" article on the > Python wiki > http://wiki.python.org/moin/PythonSpeed/PerformanceTips > and I got to the part that talks about string concatenation and that it > is faster when using join instead of += because of strin

Re: reusing parts of a string in RE matches?

2006-05-11 Thread John Salerno
Mirco Wahab wrote: > I have no idea how to do this > in Python in a terse way - but > I'll try ;-) > > In Perl, its easy. Here, the > "match construct" (\w)(?=(.)\1) > returns all captures in a > list (a 1 a 2 a 4 b 7 c 9) Ah, I see the difference. In Python you get a list of tuples, so there s

Re: which windows python to use?

2006-05-11 Thread John Salerno
Brian Blais wrote: > Hello, > > Are there any recommendations for which Windows python version to use? > I'd like to see a pros-and-cons description of each, given that > different uses might dictate different versions. The versions I know > (and there are surely more) are: > > 1) download f

Re: NEWBIE: Tokenize command output

2006-05-11 Thread Tim Chase
Lorenzo Thurman wrote: > This is what I have so far: > > // > #!/usr/bin/python > > import os > > cmd = 'ntpq -p' > > output = os.popen(cmd).read() > // > > The output is saved in the variable 'output'. What I need to do next is > select the line from that output that starts with the '*' Wel

Re: find all index positions

2006-05-11 Thread Tim Chase
> say i have string like this > astring = 'abcd efgd 1234 fsdf gfds abcde 1234' > if i want to find which postion is 1234, how can i > achieve this...? i want to use index() but it only give > me the first occurence. I want to know the positions of > both "1234" Well, I'm not sure how efficient it

Re: pythoncode in matlab

2006-05-11 Thread patrick . d . hull
check out PyMat: http://claymore.engineer.gvsu.edu/~steriana/Python/pymat.html I've never used it but I believe it should work for your needs. However, I highly recommend taking a look at SAGE: http://modular.math.washington.edu/sage/ which has an interface to octave. -ph -- http://mail.python.

Re: A critic of Guido's blog on Python's lambda

2006-05-11 Thread jayessay
"Michele Simionato" <[EMAIL PROTECTED]> writes: > jayessay wrote: > > I was saying that you are mistaken in that pep-0343 could be used to > > implement dynamically scoped variables. That stands. > > Proof by counter example: > > from __future__ import with_statement > import threading > > spe

Re: find all index positions

2006-05-11 Thread alisonken1
[EMAIL PROTECTED] wrote: > hi > say i have string like this > astring = 'abcd efgd 1234 fsdf gfds abcde 1234' > if i want to find which postion is 1234, how can i achieve this...? i > want to use index() but it only give me the first occurence. I want to > know the positions of both "1234" > thank

Re: Memory leak in Python

2006-05-11 Thread darshan . purandare
Either of it would do, I am creating a discrete time simulator. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python memory deallocate

2006-05-11 Thread Michele Petrazzo
Heiko Wundram wrote: > As was said before: as long as you keep a reference to an object, the object's > storage _will not be_ reused by Python for any other objects (which is > sensible, or would you like your object to be overwritten by other objects > before you're done with them?). Besides, eve

Re: which windows python to use?

2006-05-11 Thread nikie
Brian Blais wrote: > Hello, > > Are there any recommendations for which Windows python version to use? I'd > like to > see a pros-and-cons description of each, given that different uses might > dictate > different versions. The versions I know (and there are surely more) are: > > 1) download f

Re: find all index positions

2006-05-11 Thread Peter Otten
alisonken1 wrote: > == > def getAllIndex(aString=None, aSub=None): > t=dict() > c=0 > ndx=0 > while True: > try: > ndx=aString.index(aSub, ndx) > t[c]=ndx > ndx += 1 > c += 1 > except ValueError: >

Re: which windows python to use?

2006-05-11 Thread Scott David Daniels
Brian Blais wrote: > Are there any recommendations for which Windows python version to use? Only if you have criteria. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python memory deallocate

2006-05-11 Thread bruno at modulix
mardif wrote: > In python 2.5 this was resolved, ok, but i can't use any python version > then 2.3.5. > > This project was initializated with this version, and now it can be > dangerous change version, even because I use McMillan installer for > compile e build an executable. Err... I'm sorry I do

Re: find all index positions

2006-05-11 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > astring = 'abcd efgd 1234 fsdf gfds abcde 1234' > i want to find all positions of '1234' in astring. def positions(target, source): '''Produce all positions of target in source''' pos = -1 try: while True: po

linking with math.so

2006-05-11 Thread imdognuts
hi, My application that contains the .o's that were generated from using "freeze" needs to import math. The point of using freeze was to make a static application that can be shipped as a single entity (it contains the dot o's from libpython2.4.a), vs having to worry about external python dependen

Re: Multi-line lambda proposal.

2006-05-11 Thread Kaz Kylheku
Duncan Booth wrote: > One big problem with this is that with the decorator the function has a > name but with a lambda you have anonymous functions so your tracebacks are > really going to suck. Is this an issue with this particular design that is addressed by other designs? Are the existing one-

Re: Python memory deallocate

2006-05-11 Thread Tim Peters
[Serge Orlov] > BTW python 2.5 now returns free memory to OS, but if a program keeps > allocating more memory with each new iteration in python 2.4, it will > not help. No version of CPython ever returns memory to "the OS". All memory is obtained via the platform C's alloc() or realloc(), and any

Re: find all index positions

2006-05-11 Thread Paul Rubin
[EMAIL PROTECTED] writes: > say i have string like this > astring = 'abcd efgd 1234 fsdf gfds abcde 1234' > if i want to find which postion is 1234, how can i achieve this...? i > want to use index() but it only give me the first occurence. I want to > know the positions of both "1234" Most straig

Re: Python memory deallocate

2006-05-11 Thread mardif
OK! i will test my app with python 2.5a2 thx -- http://mail.python.org/mailman/listinfo/python-list

Re: find all index positions

2006-05-11 Thread Gary Herron
[EMAIL PROTECTED] wrote: >hi >say i have string like this >astring = 'abcd efgd 1234 fsdf gfds abcde 1234' >if i want to find which postion is 1234, how can i achieve this...? i >want to use index() but it only give me the first occurence. I want to >know the positions of both "1234" >thanks > >

Re: find all index positions

2006-05-11 Thread Gary Herron
Paul Rubin wrote: >[EMAIL PROTECTED] writes: > > >>say i have string like this >>astring = 'abcd efgd 1234 fsdf gfds abcde 1234' >>if i want to find which postion is 1234, how can i achieve this...? i >>want to use index() but it only give me the first occurence. I want to >>know the positions o

Re: Multi-line lambda proposal.

2006-05-11 Thread Kaz Kylheku
Sybren Stuvel wrote: > [EMAIL PROTECTED] enlightened us with: > > this is how I think it should be done with multi-line lambdas: > > > > def arg_range(inf, sup, f): > > return lambda(arg): > > if inf <= arg <= sup: > > return f(arg) > > else: > > raise ValueError > > This is g

Re: Install libraries only without the program itself

2006-05-11 Thread Gregor Horvath
Serge Orlov schrieb: > I believe it's better to keep *everything* on the file server. Suppose Certainly! > your OS is windows and suppose you want to keep everything in s:/tools. > The actions are: > 3. Create little dispatcher s:/tools/win32/client.py: > #!s:/tools/python24-win32/python.exe > i

Re: logging module: add client_addr to all log records

2006-05-11 Thread Joel Hedlund
> See a very similar example which uses the new 'extra' keyword argument: Now that's brilliant! Exactly what I need. But unfortunately, it's also unavailable until 2.5 comes out. Until then I'm afraid I'm stuck with my shoddy hack... but it's always nice to know the time will come when I can fi

Re: Multi-line lambda proposal.

2006-05-11 Thread Duncan Booth
Kaz Kylheku wrote: > Duncan Booth wrote: >> One big problem with this is that with the decorator the function has >> a name but with a lambda you have anonymous functions so your >> tracebacks are really going to suck. > > Is this an issue with this particular design that is addressed by > other

Reg Ex help

2006-05-11 Thread don
I have a string from a clearcase cleartool ls command. /main/parallel_branch_1/release_branch_1.0/dbg_for_python/CHECKEDOUT from /main/parallel_branch_1/release_branch_1.0/4 I want to write a regex that gives me the branch the file was checkedout on ,in this case - 'dbg_for_python' Also if ther

Re: Multi-line lambda proposal.

2006-05-11 Thread Terry Reedy
"Kaz Kylheku" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Let me make the observation that name of an inner function is, alone, > insufficient to identify that function in a debugging scenario. If you > have some inner function called I, defined within function F, you need > to

Re: Multi-line lambda proposal.

2006-05-11 Thread Kaz Kylheku
Terry Reedy wrote: > So name it err_inner. Or _err. Right. The C language approach to namespaces. -- http://mail.python.org/mailman/listinfo/python-list

Re: Reg Ex help

2006-05-11 Thread James Thiele
don wrote: > I have a string from a clearcase cleartool ls command. > > /main/parallel_branch_1/release_branch_1.0/dbg_for_python/CHECKEDOUT > from /main/parallel_branch_1/release_branch_1.0/4 > > I want to write a regex that gives me the branch the file was > checkedout on ,in this case - 'dbg_fo

Re: Reg Ex help

2006-05-11 Thread Tim Chase
> /main/parallel_branch_1/release_branch_1.0/dbg_for_python/CHECKEDOUT > from /main/parallel_branch_1/release_branch_1.0/4 > > I want to write a regex that gives me the branch the file was > checkedout on ,in this case - 'dbg_for_python' > > Also if there is a better way than using regex, please

Re: segmentation fault in scipy?

2006-05-11 Thread conor . robinson
> If I run it from the shell (unix) I get: Segmentation fault and see a > core dump in my processes. If I run it in the python shell I get as > above: > File "D:\Python24\Lib\site-packages\numpy\core\defmatrix.py", line > 149, in That's a Window's path... Does Windows even make full use o

Factory pressed dvd movies, ps2, psp & xbox backups for sale !!!

2006-05-11 Thread Movie World
We're offering all the latest factory pressed high quality dvd movies, ps2, psp and xbox silvers with factory printed colour inserts at fantastic prices, whether for personal use or reselling. We're shipping worldwide with various shipping methods. For resellers, please contact us for bulk discount

multi-threaded c++ callback problem

2006-05-11 Thread t.buehler
hi all,   i'm building a wrapper for a multi-threaded c++ library to use it in python. everything works fine except the callback.   the c++ code to call the python function: //---// void pyCallEventCallback(  CALL hCall,

  1   2   >