Re: installing 2.6 on vista64

2009-07-23 Thread Jaime Fernandez del Rio
I have installed the 32 bit 2.6 and the 64 bit 3.1 on my machine running Vista 64 without any issues. Which of course has nothing to do with your problem On Thu, Jul 23, 2009 at 7:06 PM, DwBear75 wrote: > I just downloaded and attempted to install python 2.6.2.  The > installer proceeds to do

Re: sqlite3 performance problems only in python

2009-07-23 Thread Nick Craig-Wood
David Stanek wrote: > On Thu, Jul 23, 2009 at 9:02 AM, Stef Mientki wrote: > > > > btw, I don't know if it's of any importance, the SQL-statement I perform is > > select OPNAMEN.*, NAME, NAME_, SCORES.SCORE, PATIENT.* > >  from OPNAMEN > >   inner join POID_VLID          on OPNAMEN.POID          

Re: Pep 342 (val = yield MyGenerator(foo)), synchronous os.system() that doesn't block gui event loops

2009-07-23 Thread Nick Craig-Wood
Ville Vainio wrote: > Has anyone implementing something like what the subject line > indicates? > > The idea: > > To run functions that execute a series of system commands without > blocking the ui, *and* without adding state machine logic. > > The syntax would be something like: > > de

Re: Looking for os.listdir() generator

2009-07-23 Thread Nick Craig-Wood
Christian Heimes wrote: > I'm looking for a generator version of os.listdir() for Python 2.5 and > newer. I know somebody has worked on it because I've seen a generator > version in a posting on some list or blog a while ago. I can't find it > anymore. It seems my Google fu is lacking today. A

Re: If Scheme is so good why MIT drops it?

2009-07-23 Thread Jon Harrop
Raffael Cavallaro wrote: > Yes, you are missing the joke. The point is that if python is 60x > slower than C, even if there were not a GIL, it would require running > the python program on a 60 core machine just reach parity with C. The > existence of the GIL means that in reality you'd probably ne

Re: sqlite3 performance problems only in python

2009-07-23 Thread Jerry Hill
On Thu, Jul 23, 2009 at 4:29 PM, Nick Craig-Wood wrote: > In all the databases I've used, the like operator has been case > insensitive, so if that is the problem you could use This is not true in all databases!  Many times, this is something that is configurable when setting up the database serve

2.3 missing on OSX

2009-07-23 Thread Laran Evans
I just tried to run MacVim on OSX 10.5. It crashed with this: Dyld Error Message: Library not loaded: /System/Library/Frameworks/Python.framework/ Versions/2.3/Python Referenced from: /Users/laran/Downloads/MacVim-7_2-stable-1_2/ MacVim.app/Contents/MacOS/Vim Reason: image not found I poste

Re: 2.3 missing on OSX

2009-07-23 Thread Philip Semanchuk
On Jul 23, 2009, at 4:53 PM, Laran Evans wrote: I just tried to run MacVim on OSX 10.5. It crashed with this: Dyld Error Message: Library not loaded: /System/Library/Frameworks/Python.framework/ Versions/2.3/Python Referenced from: /Users/laran/Downloads/MacVim-7_2-stable-1_2/ MacVim.app/Con

Re: 2.3 missing on OSX

2009-07-23 Thread Diez B. Roggisch
Laran Evans schrieb: I just tried to run MacVim on OSX 10.5. It crashed with this: Dyld Error Message: Library not loaded: /System/Library/Frameworks/Python.framework/ Versions/2.3/Python Referenced from: /Users/laran/Downloads/MacVim-7_2-stable-1_2/ MacVim.app/Contents/MacOS/Vim Reason: i

Re: 2.3 missing on OSX

2009-07-23 Thread Philip Semanchuk
On Jul 23, 2009, at 5:01 PM, Diez B. Roggisch wrote: Laran Evans schrieb: I just tried to run MacVim on OSX 10.5. It crashed with this: Dyld Error Message: Library not loaded: /System/Library/Frameworks/Python.framework/ Versions/2.3/Python Referenced from: /Users/laran/Downloads/MacVim-7_2-

Re: 2.3 missing on OSX

2009-07-23 Thread Ned Deily
In article , Laran Evans wrote: > I just tried to run MacVim on OSX 10.5. It crashed with this: > > Dyld Error Message: > Library not loaded: /System/Library/Frameworks/Python.framework/ > Versions/2.3/Python > Referenced from: /Users/laran/Downloads/MacVim-7_2-stable-1_2/ > MacVim.app/Cont

Re: Problems in commands.getoutput(cmd) with sox

2009-07-23 Thread Peter Otten
bbarb...@inescporto.pt wrote: > Hello to all! > > I am a new researcher, new to Python as well, and I have a problem, > when I try to get commands from sox in a python script. I am going > crazy, because this code has been working before.. so I dont really > know whats going on.. > > Ive already

Re: Problems in commands.getoutput(cmd) with sox

2009-07-23 Thread MRAB
bbarb...@inescporto.pt wrote: Hello to all! I am a new researcher, new to Python as well, and I have a problem, when I try to get commands from sox in a python script. I am going crazy, because this code has been working before.. so I dont really know whats going on.. Ive already seen some

Re: Creating xml

2009-07-23 Thread Gerhard Häring
Greg Lindstrom wrote: > It's been a while since I've played with XML using Python but I've been > asked to create XML using data from our postgres database. Currently we > are generating XML directly from the database using a set of stored > procedures but it is too slow (yes, I have numbers). I

Bridging Python and C

2009-07-23 Thread Mohan Parthasarathy
Hi, I am a newbie. It looks like there are quite a few ways to bridge Python and C. I have a bunch of C code and I just need Python wrappers for it. If i google for this I get SWIG, Boost etc. And I also see http://www.python.org/doc/2.5.2/ext/intro.html What is the recommended way for doing this

Re: Bridging Python and C

2009-07-23 Thread Christian Heimes
Mohan Parthasarathy wrote: > Hi, > I am a newbie. It looks like there are quite a few ways to bridge Python and > C. I have a bunch of C code and I just need Python wrappers for it. If i > google for this I get SWIG, Boost etc. And I also see > > http://www.python.org/doc/2.5.2/ext/intro.html > >

Re: Bridging Python and C

2009-07-23 Thread Philip Semanchuk
On Jul 23, 2009, at 5:45 PM, Mohan Parthasarathy wrote: Hi, I am a newbie. It looks like there are quite a few ways to bridge Python and C. I have a bunch of C code and I just need Python wrappers for it. If i google for this I get SWIG, Boost etc. And I also see http://www.python.org/doc

Re: sqlite3 performance problems only in python

2009-07-23 Thread Che M
On Jul 23, 3:58 pm, Stef Mientki wrote: > Piet van Oostrum wrote: > >> Stef Mientki (SM) wrote: > > >> SM> btw, I don't know if it's of any importance, the SQL-statement I > >> perform is > >> SM> select OPNAMEN.*, NAME, NAME_, SCORES.SCORE, PATIENT.* > >> SM>  from OPNAMEN > >> SM>    inner

Re: Looking for os.listdir() generator

2009-07-23 Thread Christian Heimes
Nick Craig-Wood wrote: > Christian Heimes wrote: >> I'm looking for a generator version of os.listdir() for Python 2.5 and >> newer. I know somebody has worked on it because I've seen a generator >> version in a posting on some list or blog a while ago. I can't find it >> anymore. It seems my

netCDF4 usage issues

2009-07-23 Thread Nathan
I am having issues correctly implementing the multi-file read functionality in the Python module netCDF4 (whitaker - http://code.google.com/p/netcdf4-python/). I am a relative beginner to Python, so I may be missing something simple. I've done my best to follow the example in the documentation at

Re: If Scheme is so good why MIT drops it?

2009-07-23 Thread Paul Rubin
Nobody writes: > They also have the advantage that one thread can run while another is > waiting on disk I/O, which isn't something which can be done with a > select/poll interface (even if select/poll worked for files, it doesn't > help for mapped files). AIO can help with this, but I don't know

Gedcom and Genealogy

2009-07-23 Thread Gordon
We have many small libraries in JAVA or Ruby that need to be ported to Python. Actually it's so simple a rewrite is possible too. -- http://mail.python.org/mailman/listinfo/python-list

Re: strange python scripting error

2009-07-23 Thread Mark Tarver
On 23 July, 18:01, Dennis Lee Bieber wrote: > On Thu, 23 Jul 2009 08:48:46 -0700 (PDT), Mark Tarver > declaimed the following in > gmane.comp.python.general: > > > I have a very strange error.  I have two test python files test.py and > > python.py which contain the following code > >         >

Re: sqlite3 performance problems only in python

2009-07-23 Thread Stef Mientki
Che M wrote: On Jul 23, 3:58 pm, Stef Mientki wrote: Piet van Oostrum wrote: Stef Mientki (SM) wrote: SM> btw, I don't know if it's of any importance, the SQL-statement I perform is SM> select OPNAMEN.*, NAME, NAME_, SCORES.SCORE, PATIENT.* SM> from OPNAMEN SM>i

Re: strange python scripting error

2009-07-23 Thread Mark Tarver
On 23 July, 18:01, Dennis Lee Bieber wrote: > On Thu, 23 Jul 2009 08:48:46 -0700 (PDT), Mark Tarver > declaimed the following in > gmane.comp.python.general: > > > The only hint at a difference I can see is that my ftp program says > > the files are of unequal lengths.  test.py is 129 bytes long.

Re: If Scheme is so good why MIT drops it?

2009-07-23 Thread Carl Banks
On Jul 23, 2:37 am, Nobody wrote: > On Wed, 22 Jul 2009 15:17:52 -0700, Carl Banks wrote: > > So do all these OSes have some kind of __mega_unifying_poll system > > call that works for anything that might possibly block, that you can > > exploit from a user process? > > Threads ;) Yeah, well that

passing data to a liburl2 opener object

2009-07-23 Thread scriptlear...@gmail.com
I have prepared my headers and data for a HTTP POST message; however, I am not sure how to pass the data to the opener. Can you guys provide some suggestions? Thanks. proxy_handler = urllib2.ProxyHandler({'http': 'http://my.proxy.com: 3128/'}) opener = urllib2.build_opener(proxy_handler) url =

Re: Bridging Python and C

2009-07-23 Thread Dave Angel
Mohan Parthasarathy wrote: Hi, I am a newbie. It looks like there are quite a few ways to bridge Python and C. I have a bunch of C code and I just need Python wrappers for it. If i google for this I get SWIG, Boost etc. And I also see http://www.python.org/doc/2.5.2/ext/intro.html What is the r

Re: Override a method but inherit the docstring

2009-07-23 Thread Shai
On Jul 17, 10:52 am, Steven D'Aprano wrote: > > When the decorator is called, the function object is just a function > object, not a method, so there is no concept of "what class it is > destined for". > ... which points to the better solution: use a descriptor. With the doc_inherit decorator def

Re: strange python scripting error

2009-07-23 Thread Peter Otten
Mark Tarver wrote: > On 23 July, 18:01, Dennis Lee Bieber wrote: >> On Thu, 23 Jul 2009 08:48:46 -0700 (PDT), Mark Tarver >> declaimed the following in >> gmane.comp.python.general: >> >> > The only hint at a difference I can see is that my ftp program says >> > the files are of unequal lengths.

Re: Detect target name in descriptor __set__ method

2009-07-23 Thread Gabriel Genellina
En Thu, 23 Jul 2009 10:19:33 -0300, DG escribió: On Jul 22, 6:05 pm, "Gabriel Genellina" wrote: En Wed, 22 Jul 2009 11:01:09 -0300, Rhodri James   escribió: > On Wed, 22 Jul 2009 06:02:55 +0100, Gabriel Genellina   > wrote: >> class X(object): >>    foo = descriptor() >> x = X() >> x.foo

Re: integer square roots

2009-07-23 Thread Mensanator
On Jul 23, 7:11 pm, Mensanator wrote: > On Jul 23, 6:02 pm, timro21 wrote: > > > I wish to process billions of 100-digit numbers and test if each has > > an integer square root.  What's the most efficient way to do this? > > Use gmpy. > > >>> import gmpy > >>> help(gmpy.sqrt) > > Help on built-in

Re: integer square roots

2009-07-23 Thread Paul Rubin
timro21 writes: > I wish to process billions of 100-digit numbers and test if each has > an integer square root. What's the most efficient way to do this? Is this a homework problem? If not, may I ask what the application is? I think the basic answer is 1) use the law of quadratic reciprocity

Re: integer square roots

2009-07-23 Thread Mensanator
On Jul 23, 7:17 pm, Mensanator wrote: > On Jul 23, 7:11 pm, Mensanator wrote: > > > > > > > On Jul 23, 6:02 pm, timro21 wrote: > > > > I wish to process billions of 100-digit numbers and test if each has > > > an integer square root.  What's the most efficient way to do this? > > > Use gmpy. > >

Re: invoke method on many instances

2009-07-23 Thread Aahz
In article , Gabriel Genellina wrote: > >NLMPI What? -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "At Resolver we've found it useful to short-circuit any doubt and just refer to comments in code as 'lies'. :-)" --Michael Foord paraphrases Christian Mu

Re: sqlite3 performance problems only in python

2009-07-23 Thread David Stanek
On Thu, Jul 23, 2009 at 6:29 PM, Stef Mientki wrote: > > but because the same SQL-statement in Delphi performed well, > I thought it was a problem with the Python implementation. Same SQL, but were you also using Sqlite in Delphi? -- David blog: http://www.traceback.org twitter: http://twitter.c

Re: integer square roots

2009-07-23 Thread Mensanator
On Jul 23, 6:02 pm, timro21 wrote: > I wish to process billions of 100-digit numbers and test if each has > an integer square root.  What's the most efficient way to do this? Use gmpy. >>> import gmpy >>> help(gmpy.sqrt) Help on built-in function sqrt in module gmpy: sqrt(...) sqrt(x): ret

Re: If Scheme is so good why MIT drops it?

2009-07-23 Thread Rui Maciel
fft1976 wrote: > How do you explain that something as inferior as Python beat Lisp in > the market place despite starting 40 years later. Probably due to similar reasons that lead php to become remotely relevant. Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: integer square roots

2009-07-23 Thread timro21
On Jul 24, 10:35 am, Paul Rubin wrote: > timro21 writes: > > I wish to process billions of 100-digit numbers and test if each has > > an integer square root.  What's the most efficient way to do this? > > Is this a homework problem?  If not, may I ask what the applic

Re: Pyserial and pyQt

2009-07-23 Thread David Boddie
On Thursday 23 July 2009 10:13, Dennis Lee Bieber wrote: > On Wed, 22 Jul 2009 10:32:51 -0700 (PDT), Seth > declaimed the following in gmane.comp.python.general: > >> Thanks for the response. I have gone through a lot of the tutorials. >> All of them(that I saw) seem to just deal will event-bas

Re: If Scheme is so good why MIT drops it?

2009-07-23 Thread Carl Banks
On Jul 22, 5:27 pm, Paul Rubin wrote: > Carl Banks writes: > > I don't think your fantasy async-only all-green-thread langauge > > implementation is possible anyway. > > Erlang and GHC both work like that, quite successfully: > >  http://shootout.alioth.debian.org/gp

Re: strange python scripting error

2009-07-23 Thread Dave Angel
Mark Tarver wrote: I have a very strange error. I have two test python files test.py and python.py which contain the following code #!/usr/bin/python print "Content-type: text/html" print print "" print "Hello, Linux.com!" print "" One file (test.py) works; you call it up and it shows a web pa

Re: win32clipboard operation

2009-07-23 Thread MRAB
LeeRisq wrote: On Jul 23, 9:05 am, MRAB wrote: LeeRisq wrote: Hi all, Newbie question. I've written a script that outputs to a text file. Now, I just want to copy the content to win32clipboard for access to other applications. Here's the mess I've come up with so far:) [snip] def copy_text()

Re: sqlite3 performance problems only in python

2009-07-23 Thread Christian Heimes
Stef Mientki schrieb: > hello, > > until now I used only small / simple databases in Python with sqlite3. > Now I've a large and rather complex database. > > The most simple query (with just a result of 100 rows), > takes about 70 seconds. > And all that time is consumed in "cursor.fetchall" > >

Re: If Scheme is so good why MIT drops it?

2009-07-23 Thread Paul Rubin
Carl Banks writes: > > I don't think the concept of "drivers" applies to user-mode programs. > > For FFI calls you would use an OS thread. > That's contrary to the hypothesis, isn't it? Yeah, it would have been better to say, green threads are ok for most typical forms of i/o concurrency, but OS

Re: What is file.encoding convention?

2009-07-23 Thread Naoki INADA
> What is the encoding of sys.stderr in your example? Sorry, I missed. It is cp932 > So the problem is essentially this: if a stream has an encoding > attribute, sometimes it is a wrapped stream which encodes Unicode > (e.g. a stream obtained via the codecs module) and sometimes it is not > (e.g.

Re: Help understanding the decisions *behind* python?

2009-07-23 Thread Aahz
In article , Mark Lawrence wrote: > >Sorry if this has been discussed and I've missed it, but how about >memory allocation. An immutable tuple has a fixed memory allocation >whereas that for the mutable list must be liable to change. You might >like to look at the recent thread on this ng 'L

Re: integer square roots

2009-07-23 Thread Paul Rubin
timro21 writes: > Homework? Gosh no. I have several number theory applications which > need to know (quickly) whether particular very large numbers are > perfect squares. Since I asked this in this newsgroup I guess I > assumed that responses wuld relate specifically to how to do this > efficie

Re: integer square roots

2009-07-23 Thread casevh
> comp.lang.python is a good place to get answers about Python.  It's > probably not such a good source of answers about computational number > theory.  Also, Python is more about productivity than speed, so > answers involving Python may not be the most efficient possible > answers.  One obvious p

Re: integer square roots

2009-07-23 Thread Paul Rubin
casevh writes: > gmpy.is_square() is quite fast. On a older 32-bit Linux box, it can > test approximately 400,000 100-digits numbers per second. The time > includes conversion from a string. If the numbers are already Python > longs, it can check 800,000 per second. Checking a billion is not > unr

Re: What is file.encoding convention?

2009-07-23 Thread Naoki INADA
> > Yes! I confused by it. s/I confused/I am confused/ > "Writing unicode to a file(-like)" is a simple requirement. > Does python have any simple resolution for it? s/resolution/solution/ Sorry about my poor English. -- http://mail.python.org/mailman/listinfo/python-list

Re: If Scheme is so good why MIT drops it?

2009-07-23 Thread Carl Banks
On Jul 23, 4:57 pm, Paul Rubin wrote: > Carl Banks writes: > > > I don't think the concept of "drivers" applies to user-mode programs. > > > For FFI calls you would use an OS thread. > > That's contrary to the hypothesis, isn't it? > > Yeah, it would have been better

Re: If Scheme is so good why MIT drops it?

2009-07-23 Thread Carl Banks
On Jul 23, 5:52 pm, Rui Maciel wrote: > fft1976 wrote: > > How do you explain that something as inferior as Python beat Lisp in > > the market place despite starting 40 years later. > > Probably due to similar reasons that lead php to become remotely relevant. Well, the only reason PHP became rel

Re: extract c/cpp include file with regular expression

2009-07-23 Thread tiefeng wu
Thanks, Philip Semanchuk and Nick Craig-Wood! My goal is gather informations from cpp sources and generate cross referenced html files (as more detail as fine) So I think " missing some unusual cases" might be acceptable, but informations you introduced make me more interests to dig things out :) I

Re: integer square roots

2009-07-23 Thread Tim Daneliuk
timro21 wrote: > Thanks to all! > > Tim While we're at it, would you mind saying more about what exactly you're doing - Inquiring Math Dorks (tm) want to know ... -- Tim Daneliuk tun...@tundraware.com PGP Key:

Re: regex: multiple matching for one string

2009-07-23 Thread rurpy
Nick Dumas wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Agreed. Two string.split()s, first at the semi-colon and then at the > equal sign, will yield you your value, without having to fool around > with regexes. > > On 7/23/2009 9:23 AM, Mark Lawrence wrote: >> scriptlear...@gmail.c

OverflowError in RLock.acquire()

2009-07-23 Thread David Roberts
Hi, I'm trying to port a Python application to Windows, and I'm getting the following error (which did not occur when running on Linux): Exception in thread Thread-4: Traceback (most recent call last): File "C:\Python26\lib\threading.py", line 525, in __bootstrap_inner self.run() File "C:

Re: integer square roots

2009-07-23 Thread timro21
Hi Tim, sure, I'm looking at the perfect cuboid problem. I've just spent a couple of very frustrating hours. Given that I'm in my 50's but have the brain of a retarded 3-year-old, can someone please explain what I have to do to download gmpy to use with ActivePython 2.6 on a Windows system? I do

Re: OverflowError in RLock.acquire()

2009-07-23 Thread David Roberts
I forgot to mention, Python version is 2.6.2. -- David Roberts http://da.vidr.cc/ On Fri, Jul 24, 2009 at 14:27, David Roberts wrote: > Hi, > > I'm trying to port a Python application to Windows, and I'm getting > the following error (which did not occur when running on Linux): > > Exception in

Re: integer square roots

2009-07-23 Thread casevh
On Jul 23, 9:43 pm, timro21 wrote: > Hi Tim, sure, I'm looking at the perfect cuboid problem. > > I've just spent a couple of very frustrating hours.  Given that I'm in > my 50's but have the brain of a retarded 3-year-old, can someone > please explain what I have to do to download gmpy to use wit

Re: Issue combining gzip and subprocess

2009-07-23 Thread Scott David Daniels
Piet van Oostrum wrote: Scott David Daniels (SDD) schreef: ... SDD> Or even: SDD> proc = subprocess.Popen(['ls','-la'], stdout=subprocess.PIPE) SDD> with gzip.open(filename, 'w') as dest: SDD> for line in iter(proc.stdout, ''): SDD> f.write(line) If it would work.

Re: integer square roots

2009-07-23 Thread timro21
Bloody 'ell - thanks. :-) -- http://mail.python.org/mailman/listinfo/python-list

Registering DLL

2009-07-23 Thread Girish
Hello, I am facing a problem while registering DLL(Dspace.dll).. I am getting an error saying: "DLLRegisterServer inDspace.dll Failed. Return Code: 0x80040201" I am using following piece of code to generate DLL: # This setup script builds

len() should always return something

2009-07-23 Thread Dr. Phillip M. Feldman
Some aspects of the Python design are remarkably clever, while others leave me perplexed. Here's an example of the latter: Why does len() give an error when applied to an int or float? len() should always return something; in particular, when applied to a scalar, it should return a value of 1. Of

<    1   2