ANN: wxPython 2.8.9.2 release

2009-02-19 Thread Robin Dunn
The wxWidgets team is in the early stages of preparing for a 2.8.10 release, but I already had a set of 2.8.9.2 release candidate files that I made a few days ago. Since it's still possible that there could be delays in the 2.8.10 release I thought that it would be nice to go ahead and release th

Re: Strange array.array performance

2009-02-19 Thread Scott David Daniels
Maxim Khitrov wrote: ... Here's the function that I'll be using from now on. It gives me exactly the behavior I need, with an int initializer being treated as array size. Still not as efficient as it could be if supported natively by array (one malloc instead of two + memmove + extra function cal

Re: CSV readers and UTF-8 files

2009-02-19 Thread Chris Rebert
On Thu, Feb 19, 2009 at 8:11 AM, Falcolas wrote: > On Feb 19, 7:21 am, mk wrote: >> Hello everyone, >> >> Is it just me or CSV reader/DictReader and UTF-8 files do not work >> correctly in Python 2.6.1 (Windows)? > > I would point out in the CSV module documentation (http:// > docs.python.org/lib

Re: Regular expression bug?

2009-02-19 Thread Steven D'Aprano
andrew cooke wrote: > > i wonder what fraction of people posting with "bug?" in their titles here > actually find bugs? About 99.99%. Unfortunately, 99.98% have found bugs in their code, not in Python. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Will multithreading make python less popular?

2009-02-19 Thread Steven D'Aprano
Steve Holden wrote: > What Guido doesn't seem to have accepted yet is that slowing [C]Python > down by 50% on a single-processor CPU will actually be a worthwhile > tradeoff in ten years time, when nothing will have less than eight cores > and the big boys will be running at 64 kilo-cores. Ten ye

Re: Will multithreading make python less popular?

2009-02-19 Thread Steven D'Aprano
Paul Rubin wrote: > How old is your computer, why did you buy it, and is it the first one > you ever owned? > > For most of us, I suspect, it is not our first one, and we bought it > to get a processing speedup relative to the previous one. My computer is about eight months old, and I bought it

Re: Levenshtein word comparison -performance issue

2009-02-19 Thread S.Selvam Siva
On Sat, Feb 14, 2009 at 3:01 PM, Peter Otten <__pete...@web.de> wrote: > Gabriel Genellina wrote: > > > En Fri, 13 Feb 2009 08:16:00 -0200, S.Selvam Siva < > s.selvams...@gmail.com> > > escribió: > > > >> I need some help. > >> I tried to find top n(eg. 5) similar words for a given word, from a >

Re: Will multithreading make python less popular?

2009-02-19 Thread Steven D'Aprano
Steve Holden wrote: >> It's only an error if it gets in the way. It's the experience of a lot >> of programmers that it doesn't, so it's not an error. >> > And it's not a feature of the language, rather of one or two > implementations. Neither JPython not IronPython use a GIL to the best of > my

Re: Which Version of wxPython for Win XP

2009-02-19 Thread Tim Roberts
"W. eWatson" wrote: > >I'm going to try out wxPython 2.8.92 for py25. It seems like the ansi >version is the choice for me. The other choice has unicode. Do I care? Well, there's a subtle point that gives me an opportunity to point out a lesser-known "feature" of the NT-based systems (XP, Vista,

py test

2009-02-19 Thread ssd
test b -- http://mail.python.org/mailman/listinfo/python-list

Re: Keeping the Console Open with IDLE

2009-02-19 Thread Matimus
On Feb 19, 8:06 pm, "W. eWatson" wrote: > I'm using IDLE for editing, but execute programs directly. If there are > execution or "compile" errors, the console closes before I can see what it > contains. How do I prevent that? > -- >                                 W. eWatson > >               (121

Re: "metaclass conflict" error: where is noconflict ?

2009-02-19 Thread Michele Simionato
On Feb 19, 9:58 pm, Chris Rebert wrote: > On Thu, Feb 19, 2009 at 5:01 AM, Barak, Ron wrote: > > Hi, > > > I have a class derived from two parents (in blue below), which gives me the > > following error: > > > $ python -u ./failover_pickle_demo09.py > > Traceback (most recent call last): > >   Fi

Keeping the Console Open with IDLE

2009-02-19 Thread W. eWatson
I'm using IDLE for editing, but execute programs directly. If there are execution or "compile" errors, the console closes before I can see what it contains. How do I prevent that? -- W. eWatson (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)

Re: Which Version of wxPython for Win XP

2009-02-19 Thread W. eWatson
Mike Driscoll wrote: On Feb 19, 11:29 am, "W. eWatson" wrote: W. eWatson wrote: eric_dex...@msn.com wrote: On Feb 19, 8:22 am, "W. eWatson" wrote: I'm going to try out wxPython 2.8.92 for py25. It seems like the ansi version is the choice for me. The other choice has unicode. Do I care? --

Re: Will multithreading make python less popular?

2009-02-19 Thread Tim Roberts
Paul Rubin wrote: > >C is basically never appropriate. C should be outlawed by Congress >with the ban enforced by roving pie-throwing squads . One of my favorite quotes: The last good thing written in C was Schubert's Ninth Symphony. -- Tim Roberts, t...@probo.

Matplotlib change xticks and retain xticks changing during zoom

2009-02-19 Thread dean . wheatley
Hello, I execute the following code: try: from math import * import pylab as p except: print "Couldn't import all dependent libraries" sys.exit() dataLength = 100 data = [sin(2*pi*x/dataLength) for x in range(0,dataLength)] p.plot(data) p.show() This produces a f

Re: Strange array.array performance

2009-02-19 Thread Maxim Khitrov
On Thu, Feb 19, 2009 at 10:06 PM, David Cournapeau wrote: > On Fri, Feb 20, 2009 at 11:43 AM, Maxim Khitrov wrote: >> >> Yes, I may have a case where one thread is still sending data, while >> another tries to close the connection, or two threads trying to close >> the connection at the same time

Re: To unicode or not to unicode

2009-02-19 Thread Benjamin Peterson
Ron Garret flownet.com> writes: > > I'm writing a little wiki that I call µWiki. That's a lowercase Greek > mu at the beginning (it's pronounced micro-wiki). It's working, except > that I can't actually enter the name of the wiki into the wiki itself > because the default unicode encoding o

Re: Fwd: IDLE error on 3.0.1

2009-02-19 Thread Ned Deily
In article <3f795ab3-9ba5-4833-971c-9a442cef7...@talktalk.net>, John Forse wrote: > > Occaisionally, if I mistype in python shell or try to copy & paste a > > line there, I get a permanent hang with the error below. It isn't > > corrected by quitting IDLE, but is put right with a restart. I

Re: Problems with OS X 10.5.6 and Python 2.5 and GDAL 1.6

2009-02-19 Thread Helly John J.
Thanks, Ned. Despite the problems, your help has given me something to work with. Cheers. -- John Helly, University of California, San Diego San Diego Supercomputer Center Scripps Institution of Oceanography 9500 Gilman Dr. Mail Code, La Jolla CA 92093 Phone: Voice +01 760 840 8660

Re: Strange array.array performance

2009-02-19 Thread David Cournapeau
On Fri, Feb 20, 2009 at 11:43 AM, Maxim Khitrov wrote: > > Yes, I may have a case where one thread is still sending data, while > another tries to close the connection, or two threads trying to close > the connection at the same time. In both cases, I need some parts of > the code to be atomic to

Re: Problems with OS X 10.5.6 and Python 2.5 and GDAL 1.6

2009-02-19 Thread Ned Deily
In article <2fe1a73a-5bdd-45cd-8323-ccdf68df3...@ucsd.edu>, "Helly John J." wrote: >[...] > 3. I changed the gdal_merge.py code so it uses the correct syntax > even after the error but then find that I get the original 'no module' > error, I think, because gdal_merge.py starts with the line:

Fwd: IDLE error on 3.0.1

2009-02-19 Thread John Forse
Regards John Begin forwarded message: From: John Forse Date: 20 February 2009 02:46:19 GMT To: python-list@python.org Subject: IDLE error on 3.0.1 Occaisionally, if I mistype in python shell or try to copy & paste a line there, I get a permanent hang with the error below. It isn't corr

To unicode or not to unicode

2009-02-19 Thread Ron Garret
I'm writing a little wiki that I call µWiki. That's a lowercase Greek mu at the beginning (it's pronounced micro-wiki). It's working, except that I can't actually enter the name of the wiki into the wiki itself because the default unicode encoding on my Python installation is "ascii". So I'm

Re: Strange array.array performance

2009-02-19 Thread Maxim Khitrov
On Thu, Feb 19, 2009 at 9:15 PM, John Machin wrote: > On Feb 20, 6:53 am, Maxim Khitrov wrote: >> On Thu, Feb 19, 2009 at 2:35 PM, Robert Kern wrote: >> > On 2009-02-19 12:52, Maxim Khitrov wrote: >> >> >> Hello all, >> >> >> I'm currently writing a Python<-> MATLAB interface with ctypes and >>

Re: Will multithreading make python less popular?

2009-02-19 Thread Benjamin Kaplan
On Thu, Feb 19, 2009 at 7:16 PM, Paul Rubin wrote: > Terry Reedy writes: > > > The slowness itself can be addressed by technical means, such as > > > native-code compilation and eliminating the GIL. > > > > Given that the GIL remains to make Python run faster in the usual (up > > to now, at leas

Re: Strange array.array performance

2009-02-19 Thread Maxim Khitrov
On Thu, Feb 19, 2009 at 9:34 PM, David Cournapeau wrote: > On Fri, Feb 20, 2009 at 4:53 AM, Maxim Khitrov wrote: >> On Thu, Feb 19, 2009 at 2:35 PM, Robert Kern wrote: >>> On 2009-02-19 12:52, Maxim Khitrov wrote: Hello all, I'm currently writing a Python<-> MATLAB interface

Re: Problems with OS X 10.5.6 and Python 2.5 and GDAL 1.6

2009-02-19 Thread Helly John J.
Hi. You are correct about finding the module, Ned. Thanks for that although I don't understand why it works. However, there are complications. 1. Using '/usr/bin/python' and 'from osgeo import gdal' works but throws an error the first time it's invoked. NeptuneDesk.local:/Volumes/B2_1

Re: Will multithreading make python less popular?

2009-02-19 Thread Steve Holden
Mensanator wrote: > On Feb 19, 7:18 pm, Steve Holden wrote: >> Mensanator wrote: >>> On Feb 19, 2:18 pm, Paul Rubin wrote: >> [...] >>> When I run I Python program, the Windows task manager shows both >>> cores running (usually a 60/40 split) for an overall 50% usage

Re: Strange array.array performance

2009-02-19 Thread David Cournapeau
On Fri, Feb 20, 2009 at 4:53 AM, Maxim Khitrov wrote: > On Thu, Feb 19, 2009 at 2:35 PM, Robert Kern wrote: >> On 2009-02-19 12:52, Maxim Khitrov wrote: >>> >>> Hello all, >>> >>> I'm currently writing a Python<-> MATLAB interface with ctypes and >>> array.array class, using which I'll need to p

Re: Strange array.array performance

2009-02-19 Thread John Machin
On Feb 20, 6:53 am, Maxim Khitrov wrote: > On Thu, Feb 19, 2009 at 2:35 PM, Robert Kern wrote: > > On 2009-02-19 12:52, Maxim Khitrov wrote: > > >> Hello all, > > >> I'm currently writing a Python<->  MATLAB interface with ctypes and > >> array.array class, using which I'll need to push large amo

Re: Will multithreading make python less popular?

2009-02-19 Thread Christian Heimes
Mensanator wrote: > I thought of that, but the usual Windows crap accounts for only a > couple percent prior to the Python program running. Christian Heimes > answer sounds more realistic. > > But what do I know? Be happy that your program makes use of both cores? :] You can restrict your progra

Re: Strange array.array performance

2009-02-19 Thread Maxim Khitrov
On Thu, Feb 19, 2009 at 7:01 PM, Scott David Daniels wrote: > Maxim Khitrov wrote: >> >> On Thu, Feb 19, 2009 at 2:35 PM, Robert Kern >> wrote: >> I have, but numpy is not currently available for python 2.6, which is >> what I need for some other features, and I'm trying to keep the >> dependenci

Re: Will multithreading make python less popular?

2009-02-19 Thread Mensanator
On Feb 19, 7:18 pm, Steve Holden wrote: > Mensanator wrote: > > On Feb 19, 2:18 pm, Paul Rubin wrote: > [...] > > When I run I Python program, the Windows task manager shows both > > cores running (usually a 60/40 split) for an overall 50% usage. > > > What am I actu

Re: Newby Question for reading a file

2009-02-19 Thread Steve Holden
alex23 wrote: > On Feb 20, 5:38 am, Peter Otten <__pete...@web.de> wrote: >> Yes you can get portions of the line by slicing: >> >> for line in open("infile"): >> if line[8:18] != line[18:28]: >> print line, > > You can also name the slices, which makes the code more clear (IMO): >

Re: Strange array.array performance

2009-02-19 Thread Maxim Khitrov
On Thu, Feb 19, 2009 at 7:01 PM, Scott David Daniels wrote: > Maxim Khitrov wrote: >> >> On Thu, Feb 19, 2009 at 2:35 PM, Robert Kern >> wrote: >> I have, but numpy is not currently available for python 2.6, which is >> what I need for some other features, and I'm trying to keep the >> dependenci

Re: Problems with OS X 10.5.6 and Python 2.5 and GDAL 1.6

2009-02-19 Thread Helly John J.
Thanks very much. I'll give it a go. Cheers. -- John Helly, University of California, San Diego San Diego Supercomputer Center, Mail Code 0527 Scripps Institution of Oceanography, Climate, Atmospheric Science, and Physical Oceanography, Mail Code 0224 9500 Gilman Dr., La Jolla CA

Re: Will multithreading make python less popular?

2009-02-19 Thread Steve Holden
Mensanator wrote: > On Feb 19, 2:18 pm, Paul Rubin wrote: [...] > When I run I Python program, the Windows task manager shows both > cores running (usually a 60/40 split) for an overall 50% usage. > > What am I actually seeing? If Python only uses one of the cores, >

Re: Newby Question for reading a file

2009-02-19 Thread alex23
On Feb 20, 5:38 am, Peter Otten <__pete...@web.de> wrote: > Yes you can get portions of the line by slicing: > > for line in open("infile"): >     if line[8:18] != line[18:28]: >             print line, You can also name the slices, which makes the code more clear (IMO): endda = slice(8,18) begda

Re: Will multithreading make python less popular?

2009-02-19 Thread Steve Holden
MRAB wrote: > Tim Wintle wrote: > [snip] >> Yes, we're coming to a point where we're going to have tens of cores in >> a chip, but by that time someone far cleverer than me (possibly someone >> who's on this list) will have solved that problem. The top experts in >> many fields use Python, and if t

Re: Will multithreading make python less popular?

2009-02-19 Thread Steve Holden
Paul Rubin wrote: > Tim Rowe writes: >>> I really believe that GIL is a design error. >> It's only an error if it gets in the way. It's the experience of a lot >> of programmers that it doesn't, so it's not an error. > > [...] Denying the > problem's existence is not sensible. And if wishes wer

Re: Will multithreading make python less popular?

2009-02-19 Thread Paul Rubin
Terry Reedy writes: > > The slowness itself can be addressed by technical means, such as > > native-code compilation and eliminating the GIL. > > Given that the GIL remains to make Python run faster in the usual (up > to now, at least) case of 1 processor, that seems a strange statement. We've h

Re: Will multithreading make python less popular?

2009-02-19 Thread Steve Holden
Terry Reedy wrote: > Paul Rubin wrote: > >> I would say, slow execution is a drawback that we put up with in order >> to gain benefits of Python programming that are mostly unrelated to >> the causes of the slowness. The slowness itself can be addressed by >> technical means, such as native-code

Re: Strange array.array performance

2009-02-19 Thread Scott David Daniels
Maxim Khitrov wrote: On Thu, Feb 19, 2009 at 2:35 PM, Robert Kern wrote: I have, but numpy is not currently available for python 2.6, which is what I need for some other features, and I'm trying to keep the dependencies down in any case The only feature that I'm missing with array.array is t

Re: Will multithreading make python less popular?

2009-02-19 Thread Terry Reedy
Paul Rubin wrote: I would say, slow execution is a drawback that we put up with in order to gain benefits of Python programming that are mostly unrelated to the causes of the slowness. The slowness itself can be addressed by technical means, such as native-code compilation and eliminating the G

Re: Will multithreading make python less popular?

2009-02-19 Thread MRAB
Tim Wintle wrote: [snip] Yes, we're coming to a point where we're going to have tens of cores in a chip, but by that time someone far cleverer than me (possibly someone who's on this list) will have solved that problem. The top experts in many fields use Python, and if they weren't able to make u

Re: Will multithreading make python less popular?

2009-02-19 Thread Steve Holden
Paul Rubin wrote: > Tim Rowe writes: >>> That Python is so much slower than C is yet another area where Python >>> can use improvement. >> No, because we don't use Python where C would be more appropriate. > > C is basically never appropriate. C should be outlawed by Congress > with the ban enfo

Re: Will multithreading make python less popular?

2009-02-19 Thread Christian Heimes
Mensanator wrote: > When I run I Python program, the Windows task manager shows both > cores running (usually a 60/40 split) for an overall 50% usage. > > What am I actually seeing? If Python only uses one of the cores, > why do both light up? Is everything much more complicated (due to > OS sched

Re: Will multithreading make python less popular?

2009-02-19 Thread Steve Holden
Tim Wintle wrote: > On Thu, 2009-02-19 at 12:18 -0800, Paul Rubin wrote: >> If such >> speedups were useless or unimportant, we would not have blown our hard >> earned cash replacing perfectly good older hardware, so we have to >> accept the concept that speed matters and ignore those platitudes th

Re: Will multithreading make python less popular?

2009-02-19 Thread Paul Rubin
Tim Rowe writes: > > I really believe that GIL is a design error. > It's only an error if it gets in the way. It's the experience of a lot > of programmers that it doesn't, so it's not an error. It does get in the way of quite a few of us, but I wouldn't exactly call it an error. It was a sensib

Re: os.fdopen giving "Invalid Argument" from pipes

2009-02-19 Thread Scott David Daniels
Tim Wintle wrote: On Thu, 2009-02-19 at 11:50 -0500, Jean-Paul Calderone wrote: ... (also, i before e *except* after c et cetera). Flip 'em around and all is well. Thanks - never was great at speling :-) I used to be great at spelling until I became a programmer. Programming rewards consis

Re: Will multithreading make python less popular?

2009-02-19 Thread Falcolas
On Feb 19, 3:11 pm, Paul Rubin wrote: > Falcolas writes: > > It's a proposition that used to bother me, until I did some actual > > programming of real world problems in Python. I've yet to really find > > a case where the application was slow enough to justify the c

Re: Will multithreading make python less popular?

2009-02-19 Thread Paul Rubin
Tim Rowe writes: > > That Python is so much slower than C is yet another area where Python > > can use improvement. > > No, because we don't use Python where C would be more appropriate. C is basically never appropriate. C should be outlawed by Congress with the ban enforced by roving pie-throw

Re: Will multithreading make python less popular?

2009-02-19 Thread Mensanator
On Feb 19, 2:18 pm, Paul Rubin wrote: > sturlamolden writes: > > Yes, the GIL prevents Python threads from being used in a certain way. > > But do you really need to use threads like that? Or do you just think > > you do? > > How old is your computer, why did you buy

Re: Threading and tkinter

2009-02-19 Thread Scott David Daniels
gert wrote: Hope you do not mind ignoring part of answers, so I can figure out more why things work the way they are. This two examples work, what i do not understand is that in function display i do not have to declare root, v or x ? ... x=0 def weegbrug(): global x while True:

Re: Will multithreading make python less popular?

2009-02-19 Thread Tim Wintle
On Thu, 2009-02-19 at 12:18 -0800, Paul Rubin wrote: > If such > speedups were useless or unimportant, we would not have blown our hard > earned cash replacing perfectly good older hardware, so we have to > accept the concept that speed matters and ignore those platitudes that > say otherwise. Kin

Pydev 1.4.3 Released

2009-02-19 Thread Fabio Zadrozny
Hi All, Pydev and Pydev Extensions 1.4.3 have been released Details on Pydev Extensions: http://www.fabioz.com/pydev Details on Pydev: http://pydev.sf.net Details on its development: http://pydev.blogspot.com Release Highlights in Pydev Extensions: ---

Re: iterating through files

2009-02-19 Thread Mensanator
On Feb 19, 4:56 pm, Steve Holden wrote: > Chris Rebert wrote: > > On Thu, Feb 19, 2009 at 2:28 PM, Mike Driscoll wrote: > >> On Feb 19, 4:22 pm, Mike Driscoll wrote: > >>> On Feb 19, 3:56 pm, oamram wrote: > > Hi Pythonist, > new to python. i have a directory with about 50 text file a

Re: iterating through files

2009-02-19 Thread Steve Holden
Chris Rebert wrote: > On Thu, Feb 19, 2009 at 2:28 PM, Mike Driscoll wrote: >> On Feb 19, 4:22 pm, Mike Driscoll wrote: >>> On Feb 19, 3:56 pm, oamram wrote: >>> Hi Pythonist, new to python. i have a directory with about 50 text file and i need to iterate through them and get

Re: Will multithreading make python less popular?

2009-02-19 Thread Steve Holden
Tim Rowe wrote: > 2009/2/19 : >> Hi again >> >> I really want to imply that i am not in search of a perfect language. >> Python for programming productivity is a great language but there are >> some real world facts. Some people want a language that provides great >> flexibility. A language can pr

Re: Will multithreading make python less popular?

2009-02-19 Thread Tim Rowe
2009/2/19 : > Hi again > > I really want to imply that i am not in search of a perfect language. > Python for programming productivity is a great language but there are > some real world facts. Some people want a language that provides great > flexibility. A language can provide threads and proces

Re: Will multithreading make python less popular?

2009-02-19 Thread Tim Rowe
2009/2/19 Paul Rubin : > That Python is so much slower than C is yet another area where Python > can use improvement. No, because we don't use Python where C would be more appropriate. Sure nobody would complain if Python were faster, but it's not for speed that we choose Python. Not speed of /ex

Re: Will multithreading make python less popular?

2009-02-19 Thread Tim Wintle
On Thu, 2009-02-19 at 12:48 -0800, Falcolas wrote: > That's fair, but by using a high level language in the first place, > you've already made the conscious decision to sacrifice speed for ease > of programming. Otherwise, you would probably be programming in C. My parents would have gone mad at me

Re: iterating through files

2009-02-19 Thread Chris Rebert
On Thu, Feb 19, 2009 at 2:28 PM, Mike Driscoll wrote: > On Feb 19, 4:22 pm, Mike Driscoll wrote: >> On Feb 19, 3:56 pm, oamram wrote: >> >> > Hi Pythonist, >> > new to python. i have a directory with about 50 text file and i need to >> > iterate through them and get >> > line 7 to 11 from each f

Re: iterating through files

2009-02-19 Thread Mike Driscoll
On Feb 19, 4:22 pm, Mike Driscoll wrote: > On Feb 19, 3:56 pm, oamram wrote: > > > Hi Pythonist, > > new to python. i have a directory with about 50 text file and i need to > > iterate through them and get > > line 7 to 11 from each file and write those lines into another file(one file > > that w

Re: iterating through files

2009-02-19 Thread Mike Driscoll
On Feb 19, 3:56 pm, oamram wrote: > Hi Pythonist, > new to python. i have a directory with about 50 text file and i need to > iterate through them and get > line 7 to 11 from each file and write those lines into another file(one file > that will contain all lines). > > Cheers, Omer. > -- > View th

Tkinter: stopping a background thread on demand

2009-02-19 Thread coldpizza
I am writing a Tk GUI for a console script. I start a background thread and pass it a callback function which writes debug info to a Text widget in the main Tk loop. I tried to find what is the established way to cleanly abort a child thread when the user clicks the Stop button, but apparently Pyt

Re: Will multithreading make python less popular?

2009-02-19 Thread rushenaly
Hi again I really want to imply that i am not in search of a perfect language. Python for programming productivity is a great language but there are some real world facts. Some people want a language that provides great flexibility. A language can provide threads and processes and programmer choos

Re: Will multithreading make python less popular?

2009-02-19 Thread Paul Rubin
Falcolas writes: > That's fair, but by using a high level language in the first place, > you've already made the conscious decision to sacrifice speed for ease > of programming. Otherwise, you would probably be programming in C. That Python is so much slower than C is yet another area where Pytho

Re:

2009-02-19 Thread Chris Rebert
On Thu, Feb 19, 2009 at 2:07 PM, Gary Wood wrote: > I'm stuck on a tutorial Hands on Python3 > > Exercise 1.13.7.3. ** Complete the following function. This starting code is > in joinAllStub.py. Save it to the new name joinAll.py. Note the way an > example is given in the documentation string. It

[no subject]

2009-02-19 Thread Gary Wood
I'm stuck on a tutorial Hands on Python3 Exercise 1.13.7.3. ** Complete the following function. This starting code is in joinAllStub.py. Save it to the new name joinAll.py. Note the way an example is given in the documentation string. It simulates the use of the function in the Shell. This is a

iterating through files

2009-02-19 Thread oamram
Hi Pythonist, new to python. i have a directory with about 50 text file and i need to iterate through them and get line 7 to 11 from each file and write those lines into another file(one file that will contain all lines). Cheers, Omer. -- View this message in context: http://www.nabble.com/ite

Re: Regression test test_site failed on current trunk

2009-02-19 Thread Andy
On 19 Feb., 21:47, Steve Holden wrote: > Do you mean you can't get previous lines in your Python command history > to show up? This sounds as though you may not have built the readline > support in to your experimental build. I can't remember exactly what the > deal is, but I know that readline i

Re: numpy.memmap advice?

2009-02-19 Thread Lionel
On Feb 19, 12:26 pm, Carl Banks wrote: > On Feb 19, 10:36 am, Lionel wrote: > > > > > > > On Feb 19, 9:51 am, Carl Banks wrote: > > > > On Feb 19, 9:34 am, Lionel wrote: > > > > > On Feb 18, 12:35 pm, Carl Banks wrote: > > > > > > On Feb 18, 10:48 am, Lionel wrote: > > > > > > > Thanks Carl,

Re: Regular expression bug?

2009-02-19 Thread Ron Garret
In article , Albert Hopkins wrote: > On Thu, 2009-02-19 at 10:55 -0800, Ron Garret wrote: > > I'm trying to split a CamelCase string into its constituent components. > > This kind of works: > > > > >>> re.split('[a-z][A-Z]', 'fooBarBaz') > > ['fo', 'a', 'az'] > > > > but it consumes the boun

Re: Regular expression bug?

2009-02-19 Thread Ron Garret
In article , "andrew cooke" wrote: > i wonder what fraction of people posting with "bug?" in their titles here > actually find bugs? IMHO it ought to be an invariant that len(r.split(s)) should always be one more than len(r.findall(s)). > anyway, how about: > > re.findall('[A-Z]?[a-z]*', 'fo

Re: Explanation for trailing comma in example from Learning Python?

2009-02-19 Thread Steve Holden
alex goretoy wrote: > Thank you for clerification Christian, > when using trailing comma with print statement/function, does it not > mean to output newline after printed data? > It does (in Python before 3.0) - but that has nothing to do with the original question. You will find you get quite dif

Re: Regular expression bug?

2009-02-19 Thread Ron Garret
In article , Peter Otten <__pete...@web.de> wrote: > Ron Garret wrote: > > > I'm trying to split a CamelCase string into its constituent components. > > How about > > >>> re.compile("[A-Za-z][a-z]*").findall("fooBarBaz") > ['foo', 'Bar', 'Baz'] That's very clever. Thanks! > > (BTW, I tried

Re: Regular expression bug?

2009-02-19 Thread Ron Garret
In article , MRAB wrote: > Ron Garret wrote: > > I'm trying to split a CamelCase string into its constituent components. > > This kind of works: > > > re.split('[a-z][A-Z]', 'fooBarBaz') > > ['fo', 'a', 'az'] > > > > but it consumes the boundary characters. To fix this I tried using >

Re: Explanation for trailing comma in example from Learning Python?

2009-02-19 Thread Chris Rebert
> On Thu, Feb 19, 2009 at 2:54 PM, Christian Heimes wrote: >> >> Carl Schumann wrote: >> > I could see the logic in always or never having a trailing comma. What >> > I don't understand here is why only the single element case has a >> > trailing comma. Any explanations please? >> >> Does this

Re: Explanation for trailing comma in example from Learning Python?

2009-02-19 Thread ma
A comma is what generates a tuple. It's not the parenthesis;) http://docs.python.org/library/stdtypes.html#typesseq "A single item tuple must have a trailing comma, such as (d,)." On Thu, Feb 19, 2009 at 3:57 PM, alex goretoy wrote: > Thank you for clerification Christian, > when using trailing

Re: "metaclass conflict" error: where is noconflict ?

2009-02-19 Thread Chris Rebert
On Thu, Feb 19, 2009 at 5:01 AM, Barak, Ron wrote: > Hi, > > I have a class derived from two parents (in blue below), which gives me the > following error: > > $ python -u ./failover_pickle_demo09.py > Traceback (most recent call last): > File "./failover_pickle_demo09.py", line 291, in > c

Re: Explanation for trailing comma in example from Learning Python?

2009-02-19 Thread alex goretoy
Thank you for clerification Christian, when using trailing comma with print statement/function, does it not mean to output newline after printed data? -Alex Goretoy http://www.goretoy.com On Thu, Feb 19, 2009 at 2:54 PM, Christian Heimes wrote: > Carl Schumann wrote: > > I could see the logic

Re: Python 3D CAD -- need collaborators, or just brave souls :)

2009-02-19 Thread r
On Feb 19, 2:29 am, Lie wrote: > On Feb 18, 8:02 pm, r wrote: > Blender's UI is designed for effective and efficient 3D workflow, not > for low learning curve. And that will be it's downfall! I know what what Blenders UI is designed for. However not too many people get religious about learning

Newbie request assistance....Python - PAMIE - Java

2009-02-19 Thread frankrentef
Greetings all... Newbie here to the Python world. I've written some basic script with the purpose of automating testing of an application via Python / Pamie. I've had pretty good success until a spot I'm testing displays a Java pop up. I need to have Pamie access the fields in the window (i.e.

Re: Explanation for trailing comma in example from Learning Python?

2009-02-19 Thread Christian Heimes
Carl Schumann wrote: > I could see the logic in always or never having a trailing comma. What > I don't understand here is why only the single element case has a > trailing comma. Any explanations please? Does this code shad some light on the trailing comma? :) >>> (1) == 1 True >>> (1,) == 1

Re: Regression test test_site failed on current trunk

2009-02-19 Thread Steve Holden
Andy wrote: > Hi, > > I checked out the python trunk (curently 2.7a0), compiled it on my > linux machine and run the regression test suit. Below is the output of > the failed part: > > test_site > [14871 refs] > test test_site failed -- Traceback (most recent call last): > File "/mybook/storage

Re: Will multithreading make python less popular?

2009-02-19 Thread Falcolas
On Feb 19, 1:18 pm, Paul Rubin wrote: > ...  If such > speedups were useless or unimportant, we would not have blown our hard > earned cash replacing perfectly good older hardware, so we have to > accept the concept that speed matters and ignore those platitudes that

Explanation for trailing comma in example from Learning Python?

2009-02-19 Thread Carl Schumann
Hi, I am surprised at the trailing comma in the following example from "Learning Python": Python 2.3.4 (#1, Dec 10 2007, 15:05:56) [GCC 3.4.5 20051201 (Red Hat 3.4.5-2)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> def f(*args): print args ... >>> f() ()

Re: Will multithreading make python less popular?

2009-02-19 Thread Grant Edwards
On 2009-02-19, Steve Holden wrote: > By the way, since you have chosen Java you might be interested > to know that the JPython implementation (also open source) > generates JVM bytecode, and allows you to freely mix Java and > Python classes. > > There is no Global Interpreter Lock in JPython ...

Re: Will multithreading make python less popular?

2009-02-19 Thread Steve Holden
rushen...@gmail.com wrote: > Thank you Steve, > > I really wanted to learn python, but as i said i don't want to make a > dead investment. I hope someone can fix these design errors and maybe > can write an interpreter in python :) > > Thank you so much great community... > Rushen By the way, si

Re: reading binary data from a 32 bit machine on 64 bit machine

2009-02-19 Thread Gabriel Genellina
En Thu, 19 Feb 2009 16:51:39 -0200, harijay escribió: Hi I am very confused with the use of the struct module to read binary data from a file. ( I have only worked with ascii files so far) I have a file spec for a Data-logger (http://www.dataq.com/support/ techinfo/ff.htm) That format is rat

Re: numpy.memmap advice?

2009-02-19 Thread Carl Banks
On Feb 19, 10:36 am, Lionel wrote: > On Feb 19, 9:51 am, Carl Banks wrote: > > > > > > > On Feb 19, 9:34 am, Lionel wrote: > > > > On Feb 18, 12:35 pm, Carl Banks wrote: > > > > > On Feb 18, 10:48 am, Lionel wrote: > > > > > > Thanks Carl, I like your solution. Am I correct in my understanding

Re: Will multithreading make python less popular?

2009-02-19 Thread Paul Rubin
sturlamolden writes: > Yes, the GIL prevents Python threads from being used in a certain way. > But do you really need to use threads like that? Or do you just think > you do? How old is your computer, why did you buy it, and is it the first one you ever owned? For most of us, I suspect, it is n

Re: Newby Question for reading a file

2009-02-19 Thread steven.oldner
On Feb 19, 1:44 pm, Curt Hash wrote: > On Thu, Feb 19, 2009 at 12:07 PM, steven.oldner > wrote: > > > On Feb 19, 12:40 pm, Mike Driscoll wrote: > > > On Feb 19, 12:32 pm, "steven.oldner" wrote: > > > > > Simple question but I haven't found an answer.  I program in ABAP, and > > > > in ABAP you

Re: Regular expression bug?

2009-02-19 Thread MRAB
Ron Garret wrote: I'm trying to split a CamelCase string into its constituent components. This kind of works: re.split('[a-z][A-Z]', 'fooBarBaz') ['fo', 'a', 'az'] but it consumes the boundary characters. To fix this I tried using lookahead and lookbehind patterns instead, but it doesn't

Re: "Maximum recursion depth exceeded"...why?

2009-02-19 Thread Thomas Allen
On Feb 18, 10:15 pm, rdmur...@bitdance.com wrote: > Thomas Allen wrote: > > On Feb 18, 4:51 am, alex23 wrote: > > > On Feb 18, 7:34 pm, rdmur...@bitdance.com wrote: > > > > > Yeah, but wget -r -k will do that bit of it, too. > > > > Wow, nice, I don't know why I never noticed that. Cheers! > > >

Re: Regular expression bug?

2009-02-19 Thread Peter Otten
Ron Garret wrote: > I'm trying to split a CamelCase string into its constituent components. How about >>> re.compile("[A-Za-z][a-z]*").findall("fooBarBaz") ['foo', 'Bar', 'Baz'] > This kind of works: > re.split('[a-z][A-Z]', 'fooBarBaz') > ['fo', 'a', 'az'] > > but it consumes the bounda

Re: reading binary data from a 32 bit machine on 64 bit machine

2009-02-19 Thread MRAB
harijay wrote: Hi I am very confused with the use of the struct module to read binary data from a file. ( I have only worked with ascii files so far) I have a file spec for a Data-logger (http://www.dataq.com/support/ techinfo/ff.htm) I am collecting some voltage , time traces on one channel an

Re: Strange array.array performance

2009-02-19 Thread Maxim Khitrov
On Thu, Feb 19, 2009 at 2:23 PM, Gabriel Genellina wrote: > En Thu, 19 Feb 2009 16:52:54 -0200, Maxim Khitrov > escribió: > >> input = array('B', range(256) * 1) >> >> # Case 1 >> start = clock() >> data1 = array('B', input) >> print format(clock() - start, '.10f') > >> That seems very wrong.

  1   2   3   >