Re: "as" keyword woes

2008-12-04 Thread M.-A. Lemburg
On 2008-12-04 06:42, Warren DeLano wrote: >>> Why can't the parser distinguish between a standalone " as " keyword >>> and ".as" used as an object/attribute reference? >> Because that would require special-casing some names as being >> forbidden in syntax where other names are allowed. Special case

Re: Rich Comparisons Gotcha

2008-12-10 Thread M.-A. Lemburg
On 2008-12-10 16:40, Luis Zarrabeitia wrote: > Quoting Rasmus Fogh <[EMAIL PROTECTED]>: >> Rhamphoryncus wrote: >>> You grossly overvalue using the "in" operator on lists. >> Maybe. But there is more to it than just 'in'. If you do: > c = numpy.zeros((2,)) > ll = [1, c, 3.] >> then the foll

Re: Rich Comparisons Gotcha

2008-12-10 Thread M.-A. Lemburg
On 2008-12-10 20:01, Luis Zarrabeitia wrote: > On Wednesday 10 December 2008 10:50:57 am M.-A. Lemburg wrote: >> On 2008-12-10 16:40, Luis Zarrabeitia wrote: >>> Quoting Rasmus Fogh <[EMAIL PROTECTED]>: >>>> Rhamphoryncus wrote: >> Rich comparisons

Re: getting back into programming

2008-12-10 Thread M.-A. Lemburg
On 2008-12-10 22:02, [EMAIL PROTECTED] wrote: > I used to program in C and Perl (up until 2001) (a little C++ and Java > too). Since then I've been a Business Analyst and only coded in VBA/ > Excel and written some SQL queries. (we use Sybase) > > I feel the need for other tools. > Primarily I w

Re: Rich Comparisons Gotcha

2008-12-11 Thread M.-A. Lemburg
On 2008-12-10 23:21, Luis Zarrabeitia wrote: > On Wednesday 10 December 2008 02:44:45 pm you wrote: >>> Even in statically typed languages, when you override the equality >>> operator/function you can choose not to return a valid answer (raise an >>> exception). And it would break all the cases men

Re: psycopg2 and large queries

2008-12-18 Thread M.-A. Lemburg
On 2008-12-18 22:28, Laszlo Nagy wrote: > >> Well, there are plenty of PostgreSQL modules around these days, and >> even if pyPgSQL isn't suitable, I'm sure that there must be one which >> can be made to work on Windows and to support server-side cursors. See >> here for more: >> >> http://wiki.py

Re: creating a datetime.datetime from an XML xs:dateTime

2009-01-06 Thread M.-A. Lemburg
On 2008-12-29 05:26, Jack.Chu wrote: > I think a simple regular expression is a relatively easy solution. Or use mxDateTime and let the parser do all the heavy lifting for you: >>> from mx.DateTime import Parser >>> t = Parser.DateTimeFromString('2000-01-12T12:13:14Z') >>> t >>> t = Parser.DateT

Re: python is great

2009-01-06 Thread M.-A. Lemburg
On 2009-01-06 18:36, Joe Strout wrote: > I've actually been rather frustrated by Python lately. It's great at > some things, but rather poor at others. In the latter category is > building a neatly packaged executable that can be shipped to users and > run reliably on their machine. On the Mac i

Re: looking for tips on how to implement "ruby-style" Domain Specific Language in Python

2009-01-06 Thread M.-A. Lemburg
On 2009-01-06 20:42, Kay Schluehr wrote: >> How would one approach this in Python? Do I need to build a custom >> loader which compiles *.dsl files to *.pyc files? Is it possible to >> switch between the custom DSL and the standard Python interpreter? > Sure, but there is no way to avoid extending

Re: python is great

2009-01-06 Thread M.-A. Lemburg
On 2009-01-06 21:24, Joe Strout wrote: > M.-A. Lemburg wrote: > >>> On the Mac in particular, if you want >>> your app to run on any PowerPC or Intel machine runing 10.4 or later, >>> and you're using anything not in the standard framework (such as &

Re: How to get millisec/fractional seconds out of a time object ?

2009-01-07 Thread M.-A. Lemburg
On 2009-01-06 22:34, da...@bag.python.org wrote: > Thanks for help to a beginner. > > script23 > import time > import datetime > start_time = datetime.datetime.now() > time.sleep(0.14) > end_time = datetime.datetime.now() > datetime.timedelta = end

Re: how to get the thighest bit position in big integers?

2008-10-06 Thread M.-A. Lemburg
On 2008-10-05 17:26, [EMAIL PROTECTED] wrote: > Hi, > > I'm using python to develop some proof-of-concept code for a > cryptographic application. My code makes extended use of python's > native bignum capabilities. > > In many cryptographic applications there is the need for a function > 'get_hig

Re: Builing Python 2.6 on AIX 5.2

2008-10-07 Thread M.-A. Lemburg
On 2008-10-07 12:24, brasse wrote: > OK. I have made some changes in the source that lets me build on AIX > 5.2. I thought I could post the patch here and perhaps someone can > tell me if I am on the wrong track or if this is an OK fix on AIX. Thanks. Please post the patch on the Python bug tracke

Re: [egenix-info] ANN: eGenix mx Base Distribution 3.1.1 for Python 2.6

2008-10-15 Thread M.-A. Lemburg
Just to let you know: we also provide binaries and support for Mac OS X Intel and PPC. Thanks to Joe Strout for pinging us about this. On 2008-10-15 17:41, eGenix Team: M.-A. Lemburg wrote: > > > A

Re: Possible read()/readline() bug?

2008-10-23 Thread M.-A. Lemburg
On 2008-10-22 23:00, kdwyer wrote: > On 22 Oct, 19:54, Mike Kent <[EMAIL PROTECTED]> wrote: >> Before I file a bug report against Python 2.5.2, I want to run this by >> the newsgroup to make sure I'm not being stupid. >> >> I have a text file of fixed-length records I want to read in random >> orde

Re: [APSW] SELECT COUNT(*) not succesfull?

2008-10-23 Thread M.-A. Lemburg
On 2008-10-23 09:26, Gilles Ganault wrote: > On Thu, 23 Oct 2008 00:24:01 -0200, "Gabriel Genellina" > <[EMAIL PROTECTED]> wrote: >> In case you didn't notice, B.D. already provided the answer you're after - >> reread his 3rd paragraph from the end. > > Yes, but it doesn't work with this wrapper

Re: [ANN]pygccxml - 1.0

2008-10-23 Thread M.-A. Lemburg
On 2008-10-23 09:20, Matthieu Brucher wrote: > Hi, > > I'm trying to use your package, but the gccxml installer is not > available from your website anymore. Is it possible for you to upload > it again ? Works for me: https://sourceforge.net/project/showfiles.php?group_id=118209&package_id=14654

Re: OS 10.5 build 64 bits

2008-10-23 Thread M.-A. Lemburg
Hi Robin, On 2008-10-23 17:55, Robin Becker wrote: > I'm trying to build Python from the unix sources on an OS 10.5 machine. > This is because we're getting strange faults when using the built in > python 2.5 together with some precompiled versions of MySQLdb PIL etc etc. > > The build works if

Re: OS 10.5 build 64 bits

2008-10-23 Thread M.-A. Lemburg
On 2008-10-23 20:28, Robin Becker wrote: > M.-A. Lemburg wrote: > igure script. >> >> The config options --with-universal-archs is used for this. In theory >> you could build a 4-way binary for Intel,PPC/32-bit,64-bit. >> Default is 32-bit only. > .

Re: Python26 compilation problem

2008-10-23 Thread M.-A. Lemburg
On 2008-10-23 18:32, Mathew wrote: > I am getting > Modules/config.c:39: error: expected declaration specifiers or '...' > before numeric constant > > because of > extern void initsocket(2)(void); > > in config.c > > What is this? How do I fix it? Without more information on platform, compiler,

Re: 2.6, 3.0, and truly independent intepreters

2008-10-25 Thread M.-A. Lemburg
These discussion pop up every year or so and I think that most of them are not really all that necessary, since the GIL isn't all that bad. Some pointers into the past: * http://effbot.org/pyfaq/can-t-we-get-rid-of-the-global-interpreter-lock.htm Fredrik on the GIL * http://mail.python.org/

Re: Cannot build _multiprocessing, math, mmap and readline of Python 2.6 on FreeBSD 4.11 w/ gcc 2.95.4

2008-10-25 Thread M.-A. Lemburg
On 2008-10-25 08:39, Akira Kitada wrote: > Hi list, > > I was trying to build Python 2.6 on FreeBSD 4.11 and found it failed > to build some of the modules. > > """ > Failed to find the necessary bits to build these modules: > _bsddb _sqlite3 _tkinter > gdbm li

Re: Cannot build _multiprocessing, math, mmap and readline of Python 2.6 on FreeBSD 4.11 w/ gcc 2.95.4

2008-10-27 Thread M.-A. Lemburg
D4, yeah it's really dated and I understand newer FreeBSD should > make my life easier, but I would rather want Python continue to > support old system like this > as long as it's not getting very hard to maintain the clean code base. Sure, the more platforms the better. > Thanks

Re: Type feedback tool?

2008-10-27 Thread M.-A. Lemburg
On 2008-10-26 13:54, Martin Vilcans wrote: > Hi list, > > I'm wondering if there's a tool that can analyze a Python program > while it runs, and generate a database with the types of arguments and > return values for each function. In a way it is like a profiler, that > instead of measuring how of

Re: Database specialized in storing directed graphs?

2008-10-28 Thread M.-A. Lemburg
On 2008-10-28 01:32, Carl Banks wrote: > I was wondering if anyone had any advice on this. > > This is not to study graph theory; I'm using the graph to represent a > problem domain. The graphs could be arbitrarily large, and could > easily have millions of nodes, and most nodes have a substantia

Re: modifying locals

2008-10-31 Thread M.-A. Lemburg
On 2008-10-31 09:08, Tino Wildenhain wrote: > Hi, > > Steven D'Aprano wrote: >> On Fri, 31 Oct 2008 07:10:05 +0100, Tino Wildenhain wrote: >> >>> Also, locals() already returns a dict, no need for the exec trickery. >>> You can just modify it: >>> >>> >>> locals()["foo"]="bar" >>> >>> foo >>> 'b

Re: python openssl x509 CA

2008-10-31 Thread M.-A. Lemburg
On 2008-10-31 11:10, Marcin Jurczuk wrote: > Hello, > I'm fighting with Certificate Authority functionality with python > I stuck on following problem: How to sign CSR using CA key and write > resulted certificate. > > You can do it using following openssl cmd: > openssl ca -cert CA/cert.pem -keyf

Re: Python 2.5: wrong number of arguments given in TypeError for function argument aggregation (dictionary input vs the norm)

2008-10-31 Thread M.-A. Lemburg
On 2008-10-31 00:18, John Krukoff wrote: > On Fri, 2008-10-31 at 08:55 +1000, James Mills wrote: >> What you have discovered is not a bug :) >> >> cheers >> James >> > > Are you sure? It looks like his complaint isn't that it doesn't work, > but that the error message is misleading. > > With the

Re: Efficient way to remove objects from a list

2008-11-03 Thread M.-A. Lemburg
On 2008-11-03 12:12, M.-A. Lemburg wrote: >> 一首诗 wrote: >>> Hi all, >>> >>> Today I wrote some code like this: >>> >>> for m in self.messages: >>> if not m.finished: >>> continue >&g

Re: Efficient way to remove objects from a list

2008-11-03 Thread M.-A. Lemburg
> 一首诗 wrote: >> Hi all, >> >> Today I wrote some code like this: >> >> for m in self.messages: >> if not m.finished: >> continue >> >> #process the message >> >> fini = [m for m in self.messages if m.finished] >> for m in fini: >>

Re: PEP 249 - DB API question

2008-11-04 Thread M.-A. Lemburg
On 2008-11-04 18:52, k3xji wrote: > Hi all, > > As development goes on for a server project, it turns out that I am > using the MySQLDB and DB interactions excessively. One questions is > just bothering me, why don't we have a timeout for queries in PEP 249 > (DB API)? > > Is it really safe to wa

Re: Error loading modules

2008-11-06 Thread M.-A. Lemburg
The easiest way to debug such import problems is by telling Python to be verbose: python -vv -c "import some_module" The generated output will then list all the locations where Python looks for the module and is often handy to track down reasons for Python not being able to load a module. -- Ma

Re: Trying to set a date field in a access databse

2008-11-06 Thread M.-A. Lemburg
On 2008-11-05 21:12, [EMAIL PROTECTED] wrote: > Hi, > I cannot get the following code to work > > import win32com.client > import time > > engine = win32com.client.Dispatch("DAO.DBEngine.36") > db=engine.OpenDatabase(r"testdate2.mdb") > access = db.OpenRecordset("select * from test") > > access.

Re: Step-by-step exec

2008-11-07 Thread M.-A. Lemburg
On 2008-11-07 11:48, [EMAIL PROTECTED] wrote: > On Nov 7, 11:20 am, Steven D'Aprano <[EMAIL PROTECTED] > cybersource.com.au> wrote: > >>> What I am trying to do is to execute it "step-by-step", so that I can >>> capture the exception if one line (or multi-line statement) fails, print >>> a warning

Re: adodbapi and output parameters in stored procedures

2008-11-07 Thread M.-A. Lemburg
On 2008-11-07 15:04, [EMAIL PROTECTED] wrote: > Hello, > > I need some help getting output values from my stored procedures when > using adodbapi. There's an example > testVariableReturningStoredProcedure in adodbapitest.py, and that > works for my system. But my stored procedure also inserts an

Re: adodbapi and output parameters in stored procedures

2008-11-08 Thread M.-A. Lemburg
On 2008-11-07 17:32, [EMAIL PROTECTED] wrote: > Thanks for that excellent pointer! > > I was able to do just what you said with > > But if my procedure has an insert statement in its midst, it doesn't > work. The cursor.fetchall() gets an exception. > Any ideas? Try this (I haven't checked that

Re: Python 3.0 - is this true?

2008-11-11 Thread M.-A. Lemburg
On 2008-11-11 02:10, Steven D'Aprano wrote: > On Mon, 10 Nov 2008 12:51:51 +, Duncan Grisby wrote: > >> I have an object database written in Python. It, like Python, is >> dynamically typed. It heavily relies on being able to sort lists where >> some of the members are None. To some extent, it

Re: need to suspend/resume a child thread

2008-11-13 Thread M.-A. Lemburg
On 2008-11-13 02:57, scsoce wrote: > A child thread has a long-time executions, how to suspend it and resume > back the orignial place ? I know it' nature to use singal, but child > thread cannot get signal as Python Manual say. And i dnt like to check > status variable as the long-time executi

Re: Easy caching

2008-11-13 Thread M.-A. Lemburg
On 2008-11-13 09:03, Peter Otten wrote: > jalanb3 wrote: > >> Evening all, >> >> And thank you for your valuable reading skills. >> >> The following pattern turned up in coding tonight. >> It works, but I'm suspicious, it just seems too easy. >> >> So any comments or constructive criticisms welcom

Re: Python IF THEN chain equivalence

2008-11-13 Thread M.-A. Lemburg
On 2008-11-13 23:31, jzakiya wrote: > On Nov 13, 5:21 pm, Alan Baljeu <[EMAIL PROTECTED]> wrote: >> I think you should rethink your post. The first case you posted makes no >> sense in any language I know. Also, a whole lot of nested IF's is a bad >> idea in any language. In Python, you will en

Re: Python IF THEN chain equivalence

2008-11-13 Thread M.-A. Lemburg
On 2008-11-14 00:19, jzakiya wrote: > On Nov 13, 5:48 pm, "M.-A. Lemburg" <[EMAIL PROTECTED]> wrote: >>>> From: jzakiya <[EMAIL PROTECTED]> >>>> To: [EMAIL PROTECTED] >>>> Sent: Thursday, November 13, 2008 5:06:53 PM >>>> Su

Re: how to get all repeated group with regular expression

2008-11-21 Thread M.-A. Lemburg
On 2008-11-21 15:31, scsoce wrote: > say, when I try to search and match every char from variable length > string, such as string '123456', ??? That's a strange requirement. If you want to match every character, then why are you using a regular expression for this ? > i tried re.findall( r'(\d)

Re: Need help converting text to csv format

2008-11-21 Thread M.-A. Lemburg
On 2008-11-21 16:18, Chuck Connors wrote: > Hey guys. I'm working on a little program to help my wife catalog her/ > our coupons. I found a good resource but need help formatting the > text data so that I can import it into a mysql database. Here's the > data format: > > 40922003 Life Fitnes

Re: PyCrypto AES MODE_CBC - How to?

2009-02-26 Thread M.-A. Lemburg
On 2009-02-25 13:25, Helmut Jarausch wrote: > Helmut Jarausch wrote: >> Hi, >> >> I've just tried to write a simple example using PyCrypto's >> AES (CBC mode) >> >> #!/usr/bin/python >> from Crypto.Cipher import AES >> >> PWD='abcdefghijklmnop' >> Initial16bytes='0123456789ABCDEF' >> >> crypt = AES

Re: split problem if the delimiter is inside the text limiter

2009-03-19 Thread M.-A. Lemburg
On 2009-03-19 00:30, Tim Chase wrote: > Bruno Desthuilliers wrote: >> Tim Chase a écrit : >>> (if your columns in your CSV happen to match the order of your INSERT >>> statement, you can just use >>> >>> execute(sql, tuple(row)) >> >> Or more simply: >> >> cursor.execute(sql, row) > > that'

Re: mxODBC (was "split problem if the delimiter is inside the text limiter")

2009-03-19 Thread M.-A. Lemburg
On 2009-03-19 13:40, Tim Chase wrote: >> DB-API 2.0 has cursor.executemany() to make this differentiation >> at the API level. mxODBC will lift this requirement in the next >> version, promised :-) > > glad to hear...will executemany() take an arbitrary iterable? My > (albeit somewhat-antiquated

Re: Unicode problem in ucs4

2009-03-20 Thread M.-A. Lemburg
On 2009-03-20 12:13, abhi wrote: > On Mar 20, 11:03 am, "Martin v. Löwis" wrote: >>> Any idea on why this is happening? >> Can you provide a complete example? Your code looks correct, and should >> just work. >> >> How do you know the result contains only 't' (i.e. how do you know it >> does not c

Re: Unicode problem in ucs4

2009-03-23 Thread M.-A. Lemburg
On 2009-03-23 08:18, abhi wrote: > On Mar 20, 5:47 pm, "M.-A. Lemburg" wrote: >>> unicodeTest.c >>> #include >>> static PyObject *unicode_helper(PyObject *self,PyObject *args){ >>>PyObject *sampleObj = NULL; >>>Py_UNICOD

Re: Unicode problem in ucs4

2009-03-23 Thread M.-A. Lemburg
On 2009-03-23 11:50, abhi wrote: > On Mar 23, 3:04 pm, "M.-A. Lemburg" wrote: > Thanks Marc, John, > With your help, I am at least somewhere. I re-wrote the code > to compare Py_Unicode and wchar_t outputs and they both look exactly > the same. > >

Re: Unicode problem in ucs4

2009-03-23 Thread M.-A. Lemburg
On 2009-03-23 14:05, abhi wrote: > Hi Marc, >Is there any way to ensure that wchar_t size would always be 2 > instead of 4 in ucs4 configured python? Googling gave me the > impression that there is some logic written in PyUnicode_AsWideChar() > which can take care of ucs4 to ucs2 conversion

Re: Unicode problem in ucs4

2009-03-23 Thread M.-A. Lemburg
On 2009-03-23 12:57, abhi wrote: >>> Is there any way >>> by which I can force wchar_t to be 2 bytes, or can I convert this UCS4 >>> data to UCS2 explicitly? >> Sure: just use the appropriate UTF-16 codec for this. >> >> /* Generic codec based encoding API. >> >>object is passed through the enc

Re: [Python-Dev] PEP 382: Namespace Packages

2009-04-02 Thread M.-A. Lemburg
On 2009-04-02 17:32, Martin v. Löwis wrote: > I propose the following PEP for inclusion to Python 3.1. Thanks for picking this up. I'd like to extend the proposal to Python 2.7 and later. > Please comment. > > Regards, > Martin > > Specification > = > > Rather than using an impera

Re: [Python-Dev] PEP 382: Namespace Packages

2009-04-07 Thread M.-A. Lemburg
[Resent due to a python.org mail server problem] On 2009-04-03 22:07, Martin v. Löwis wrote: >> I'd like to extend the proposal to Python 2.7 and later. > > I don't object, but I also don't want to propose this, so > I added it to the discussion. > > My (and perhaps other people's) concern is th

Re: [Python-Dev] PEP 382: Namespace Packages

2009-04-07 Thread M.-A. Lemburg
On 2009-04-03 02:44, P.J. Eby wrote: > At 10:33 PM 4/2/2009 +0200, M.-A. Lemburg wrote: >> Alternative Approach: >> - >> >> Wouldn't it be better to stick with a simpler approach and look for >> "__pkg__.py" files to detect name

Re: [Python-Dev] PEP 382: Namespace Packages

2009-04-07 Thread M.-A. Lemburg
On 2009-04-07 16:05, P.J. Eby wrote: > At 02:30 PM 4/7/2009 +0200, M.-A. Lemburg wrote: >> >> Wouldn't it be better to stick with a simpler approach and look for >> >> "__pkg__.py" files to detect namespace packages using that O(1) >> check

Re: [Python-Dev] PEP 382: Namespace Packages

2009-04-14 Thread M.-A. Lemburg
On 2009-04-07 19:46, P.J. Eby wrote: > At 04:58 PM 4/7/2009 +0200, M.-A. Lemburg wrote: >> On 2009-04-07 16:05, P.J. Eby wrote: >> > At 02:30 PM 4/7/2009 +0200, M.-A. Lemburg wrote: >> >> >> Wouldn't it be better to stick with a simpler approach and look

Re: [Python-Dev] PEP 382: Namespace Packages

2009-04-14 Thread M.-A. Lemburg
On 2009-04-14 18:27, P.J. Eby wrote: > At 05:02 PM 4/14/2009 +0200, M.-A. Lemburg wrote: >> I don't see the emphasis in the PEP on Linux distribution support and the >> remote possibility of them wanting to combine separate packages back >> into one package as good argum

Re: [Python-Dev] PEP 382: Namespace Packages

2009-04-15 Thread M.-A. Lemburg
On 2009-04-15 02:32, P.J. Eby wrote: > At 10:59 PM 4/14/2009 +0200, M.-A. Lemburg wrote: >> You are missing the point: When breaking up a large package that lives in >> site-packages into smaller distribution bundles, you don't need namespace >> packages at all, so the PE

Re: [Python-Dev] PEP 382: Namespace Packages

2009-04-15 Thread M.-A. Lemburg
On 2009-04-15 16:44, P.J. Eby wrote: > At 09:51 AM 4/15/2009 +0200, M.-A. Lemburg wrote: >> On 2009-04-15 02:32, P.J. Eby wrote: >> > At 10:59 PM 4/14/2009 +0200, M.-A. Lemburg wrote: >> >> You are missing the point: When breaking up a large package that >&g

Re: [Python-Dev] PEP 382: Namespace Packages

2009-04-15 Thread M.-A. Lemburg
On 2009-04-15 19:38, James Y Knight wrote: > > On Apr 15, 2009, at 12:15 PM, M.-A. Lemburg wrote: > >> The much more common use case is that of wanting to have a base package >> installation which optional add-ons that live in the same logical >> package namespace. &

Re: [Python-Dev] PEP 382: Namespace Packages

2009-04-15 Thread M.-A. Lemburg
On 2009-04-15 19:59, P.J. Eby wrote: > At 06:15 PM 4/15/2009 +0200, M.-A. Lemburg wrote: >> The much more common use case is that of wanting to have a base package >> installation which optional add-ons that live in the same logical >> package namespace. > > Please s

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-22 Thread M.-A. Lemburg
On 2009-04-22 22:06, Walter Dörwald wrote: > Martin v. Löwis wrote: >>> "correct" -> "corrected" >> Thanks, fixed. >> To convert non-decodable bytes, a new error handler "python-escape" is introduced, which decodes non-decodable bytes using into a private-use character U+F01xx, which

Re: [Python-Dev] PEP 384: Defining a Stable ABI

2009-05-25 Thread M.-A. Lemburg
Martin v. Löwis wrote: > Thomas Wouters reminded me of a long-standing idea; I finally > found the time to write it down. > > Please comment! > ... > Up until this PEP proposal, we had a very simple scheme for the Python C-API: all documented functions and variables with a "Py" prefix were part o

Re: [Python-Dev] PEP 384: Defining a Stable ABI

2009-05-26 Thread M.-A. Lemburg
Martin v. Löwis wrote: >> Now, with the PEP, I have a feeling that the Python C-API >> will in effect be limited to what's in the PEP's idea of >> a usable ABI and open up the non-inluded public C-APIs >> to the same rate of change as the private APIs. > > That's certainly not the plan. Instead, t

Re: Is there no single/uniform RDBMS access API module for Python ?

2008-05-13 Thread M.-A. Lemburg
On 2008-05-12 07:43, Banibrata Dutta wrote: Hi, Again a noob question. Based on this URL http://wiki.python.org/moin/DatabaseInterfaces , is it correct to conclude that there is no RDBMS agnostic, single/uniform DB access API for Python ? Something in the lines of JDBC for Java, DBD for Perl et

Re: multiple databases, what's the best interface ?

2008-05-18 Thread M.-A. Lemburg
On 2008-05-17 20:54, Stef Mientki wrote: hello, I need to switch fluently between 2 or 3 types of dbases: SQLite, Sybase ( and in the future MS SQL-server). I need both closed application and general purpose database manager, which should run on different platforms (windows, windows mobile, not

Re: Python 2.5.2 on Ubuntu Hardy Utf-8-Euro error

2008-05-30 Thread M.-A. Lemburg
On 2008-05-30 17:41, Peter Otten wrote: Josep wrote: I'm playing with an application framework (or kinda) that's developed with python, and it throws this error: File "/usr/lib/python2.5/site-packages/Dabo-0.8.3-py2.5.egg/dabo/db/dCursorMixin.py", line 281, in execute sql = unicode(sql,

Re: Python 2.5.2 on Ubuntu Hardy Utf-8-Euro error

2008-05-30 Thread M.-A. Lemburg
On 2008-05-30 22:37, M.-A. Lemburg wrote: On 2008-05-30 17:41, Peter Otten wrote: Josep wrote: I'm playing with an application framework (or kinda) that's developed with python, and it throws this error: File "/usr/lib/python2.5/site-packages/Dabo-0.8.3-py2.5.egg/dabo/db/

Re: Database Query Contains Old Data

2008-06-03 Thread M.-A. Lemburg
On 2008-06-03 00:17, James A. Donald wrote: On Wed, 21 May 2008 07:23:04 -0700 (PDT), Paul Boddie MySQL appears to use "repeatable read" by default [1] as its transaction isolation level, whereas PostgreSQL (for example) uses "read committed" by default [2]. I would guess that if you were using

Re: Database Query Contains Old Data

2008-06-04 Thread M.-A. Lemburg
On 2008-06-03 14:29, James A. Donald wrote: On Tue, 03 Jun 2008 12:07:07 +0200, "M.-A. Lemburg" <[EMAIL PROTECTED]> wrote: As others have mentioned, in systems that have long running logical transactions, it's usually best to collect the data until the very end and then app

Re: a python phpmyadmin like program

2008-06-04 Thread M.-A. Lemburg
On 2008-06-03 20:49, Gandalf wrote: is their any graphic program for handling sqlite like phpmyadmin or access in python? If you run Firefox: https://addons.mozilla.org/en-US/firefox/addon/5817 -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jun

Re: Keep a script running in the background

2008-06-04 Thread M.-A. Lemburg
On 2008-06-04 01:33, Guillermo wrote: These are the basic requirements: Script A must keep a dictionary in memory constantly and script B must be able to access and update this dictionary at any time. Script B will start and end several times, but script A would ideally keep running until it's e

Re: [egenix-info] Re: ANN: eGenix pyOpenSSL Distribution 0.7.0-0.9.8h-1

2008-06-13 Thread M.-A. Lemburg
On 2008-06-13 11:27, eGenix Team: M.-A. Lemburg wrote: On 2008-06-13 09:39, Helmut Jarausch wrote: eGenix Team: M.-A. Lemburg wrote: ANNOUNCING eGenix.com pyOpenSSL Distribution

Re: Temporal Databases (Database design questions)

2008-06-18 Thread M.-A. Lemburg
On 2008-06-18 09:41, David wrote: Question 3: Temporal databases http://en.wikipedia.org/wiki/Temporal_database I haven't used them before, but I like the idea of never deleting/updating records so you have a complete history (a bit like source code version control). How well do temporal datab

Re: Getting column names from a cursor using ODBC module?

2008-06-27 Thread M.-A. Lemburg
John Machin wrote: > On Jun 21, 11:58 pm, [EMAIL PROTECTED] wrote: >> Is there any way to retrieve column names from a cursor using the ODBC >> module? Or must I, in advance, create a dictionary of column position >> and column names for a particular table before I can access column >> values by co

Re: Multiprecision arithmetic library question.

2008-06-27 Thread M.-A. Lemburg
duncan smith wrote: > Michael Press wrote: >> In article <[EMAIL PROTECTED]>, >> Mark Wooding <[EMAIL PROTECTED]> wrote: >> >>> Michael Press <[EMAIL PROTECTED]> wrote: >>> I already compiled and installed the GNU multiprecision library on Mac OS X, and link to it in C programs. How do I

Re: convert unicode characters to visibly similar ascii characters

2008-07-02 Thread M.-A. Lemburg
On 2008-07-01 20:31, Peter Bulychev wrote: Hello. I want to convert unicode character into ascii one. The method ".encode('ASCII') " can convert only those unicode characters, which fit into 0..128 range. But there are still lots of characters beyond this range, which can be manually converted

Re: Win32.client, DAO.DBEngine and exceeding the file sharing count lock

2008-07-02 Thread M.-A. Lemburg
On 2008-07-02 16:54, Iain King wrote: On Jul 2, 3:29 pm, Tim Golden <[EMAIL PROTECTED]> wrote: Iain King wrote: Hi. I'm using the win32 module to access an Access database, but I'm running into the File Sharing lock count as inhttp://support.microsoft.com/kb/815281 The solution I'd like to us

Re: Converting from local -> UTC

2008-07-17 Thread M.-A. Lemburg
On 2008-07-16 20:00, Keith Hughitt wrote: Thanks Gabriel! That helps clear things up for me. The above method works very well. I only have one remaining question: How can I pass a datetime object to MySQL?' So far, what I've been doing is building the query as a string, for example: query = "I

Re: Converting from local -> UTC

2008-07-17 Thread M.-A. Lemburg
On 2008-07-17 22:43, Dennis Lee Bieber wrote: On Thu, 17 Jul 2008 19:55:44 +0200, "M.-A. Lemburg" <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: Use binding parameters and it should work: query = "INSERT INTO image VALUES(%d, %d, %s, '%s'

Re: Converting from local -> UTC

2008-07-18 Thread M.-A. Lemburg
On 2008-07-18 05:28, Dennis Lee Bieber wrote: On Thu, 17 Jul 2008 20:26:11 -0300, "Gabriel Genellina" <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: Note that I used %s everywhere (it's just a placeholder, not a format) and Unfortunately, in the case of M

Re: persistent deque (continued)

2008-07-21 Thread M.-A. Lemburg
On 2008-07-21 21:08, castironpi wrote: Some time ago, I was asking about the feasibility of a persistent deque, a double-ended queue. You might want to have a look at mxBeeBase: http://www.egenix.com/products/python/mxBase/mxBeeBase/ Using the integer index you could probably write an on-disk

Re: Questions on 64 bit versions of Python

2008-07-25 Thread M.-A. Lemburg
On 2008-07-25 08:13, [EMAIL PROTECTED] wrote: Background: I'm going to be processing some raw transaction logs that are 30G in size. As part of this processing I may need to create some very large dictionary structures. I will be running my scripts on a version of Windows 2003 Server Enterprise E

Re: Gracefull application exit.

2008-07-26 Thread M.-A. Lemburg
On 2008-07-24 18:06, Robert Rawlins wrote: Chaps, I'm looking to implement an exit/termination process for an application which can be triggered by A) a keyboard interrupt or B) termination of the application as a Daemon using a signal. I have a whole bunch of tasks I want to perform as

Re: Gracefull application exit.

2008-07-26 Thread M.-A. Lemburg
On 2008-07-26 20:30, M.-A. Lemburg wrote: On 2008-07-24 18:06, Robert Rawlins wrote: Chaps, I'm looking to implement an exit/termination process for an application which can be triggered by A) a keyboard interrupt or B) termination of the application as a Daemon using a signal.

Re: xlrd: error open_workbook

2008-07-29 Thread M.-A. Lemburg
On 2008-07-28 22:22, Fabio Oikawa wrote: Hello. I am trying to open an .xls (excel) file using xlrd, but an error message occurs when I open the workbook. I can open any other .xls file made by myself (either by MS Excel 2003 SP3 in Windows Vista or by OpenOffice 2.0 in Debian) using the *open_

Re: Optimizing size of very large dictionaries

2008-07-31 Thread M.-A. Lemburg
On 2008-07-31 02:29, [EMAIL PROTECTED] wrote: Are there any techniques I can use to strip a dictionary data structure down to the smallest memory overhead possible? I'm working on a project where my available RAM is limited to 2G and I would like to use very large dictionaries vs. a traditional

Re: Interbase

2008-07-31 Thread M.-A. Lemburg
On 2008-07-30 18:49, Mike Hjorleifsson wrote: Has anyone gotten python working with Interbase database platform ? I need to query some info from an interbase database on another server need a lil help getting started. You could try the EasySoft ODBC driver for InterBase: http://www.easysoft.

Re: DB-API corner case (psycopg2)

2008-08-01 Thread M.-A. Lemburg
On 2008-08-01 15:44, Thomas Guettler wrote: Hi, I discovered this: import psycopg2 connection=psycopg2.connect("dbname='...' user='...'") cursor=connection.cursor() cursor.execute('''SELECT '%' ''') # Does not fail cursor.execute('''SELECT '%' ''', ()) # Does fail Traceback (most recent call l

Re: DB-API corner case (psycopg2)

2008-08-01 Thread M.-A. Lemburg
On 2008-08-01 20:38, Thomas Guettler wrote: I forgot to mention where I stumbled about this. Django has a wrapper: http://code.djangoproject.com/browser/django/trunk/django/db/backends/util.py def execute(self, sql, params=()): start = time() try:

Re: mktime overflow in March 2008?

2008-08-07 Thread M.-A. Lemburg
On 2008-08-07 20:40, Robert Latest wrote: Here's what happens on my Windows machine (Win XP / Cygwin) at work. I've googled a bit about this problem but only found references to instances where people referred to dates before the Epoch. Of course at home on my Linux box everything works. I know

Re: Fastest way to store ints and floats on disk

2008-08-07 Thread M.-A. Lemburg
On 2008-08-07 20:41, Laszlo Nagy wrote: Hi, I'm working on a pivot table. I would like to write it in Python. I know, I should be doing that in C, but I would like to create a cross platform version which can deal with smaller databases (not more than a million facts). The data is first i

Re: Replace Several Items

2008-08-14 Thread M.-A. Lemburg
On 2008-08-13 23:54, John Krukoff wrote: On Wed, 2008-08-13 at 09:39 -0700, gjhames wrote: I wish to replace several characters in my string to only one. Example, "-", "." and "/" to nothing "" I did like that: my_string = my_string.replace("-", "").replace(".", "").replace("/", "").replace(")",

Re: object-relational mappers

2008-04-03 Thread M.-A. Lemburg
On 2008-04-01 22:40, Aaron Watters wrote: > I've been poking around the world of object-relational > mappers and it inspired me to coin a corellary to the > the famous quote on regular expressions: > > "You have objects and a database: that's 2 problems. > So: get an object-relational mapper: > no

Re: Unicode conversion problem (codec can't decode)

2008-04-04 Thread M.-A. Lemburg
On 2008-04-04 08:18, Jason Scheirer wrote: > On Apr 3, 9:35 pm, "Eric S. Johansson" <[EMAIL PROTECTED]> wrote: >> I'm having a problem (Python 2.4) converting strings with random 8-bit >> characters into an escape form which is 7-bit clean for storage in a >> database. If you don't want to proces

Re: Learning curve for new database program with Python?

2008-04-07 Thread M.-A. Lemburg
On 2008-04-07 15:30, Greg Lindstrom wrote: > On Sun, Apr 6, 2008 at 2:31 AM, John Nagle <[EMAIL PROTECTED]> wrote: >> Basic SQL isn't that hard. Learn CREATE, SELECT, INSERT, >> UPDATE, and DELETE syntax. That's enough for most simple >> applications. > > And then learn more advanced SQL:

Re: Learning curve for new database program with Python?

2008-04-09 Thread M.-A. Lemburg
On 2008-04-07 20:19, Gary Duzan wrote: > In article <[EMAIL PROTECTED]>, > M.-A. Lemburg <[EMAIL PROTECTED]> wrote: >> On 2008-04-07 15:30, Greg Lindstrom wrote: >>> SQL is one of the areas I wish I had mastered (much) earlier in my career >> Fully agree :

Re: Compiling Python 2.5.2 on AIX 5.2

2008-04-14 Thread M.-A. Lemburg
On 2008-04-13 18:57, [EMAIL PROTECTED] wrote: > I'm investigating the possible use of Mecurial SCM as a replacement > for CVS. Mecurial is written in Python. I have a background in GNU/ > Linux, Solaris, sparc and Perl. However AIX, powerpc and Python are > new to me. On AIX 5.3, Python 2.5.2 s

Re: Python module for reading FilePro files?

2008-04-17 Thread M.-A. Lemburg
On 2008-04-16 15:53, Steve Bergman wrote: > Does anyone know of a Python package or module to read data files from > the venerable old Filepro crossplatform database/IDE? No, but there is Filepro support in PHP, so you could write a PHP script which reads the data and then exports it to some other

Re: Tidy module?

2008-04-17 Thread M.-A. Lemburg
On 2008-04-17 21:00, Mark Reed wrote: > Is there an easy_installable egg with an interface to libtidy? I > found µTidy, but it looks like an inactive project, with no updates > since 2004, so I'm skeptical of its reliability. I found mxTidy, but > it's only available as part of some larger distri

<    1   2   3   4   5   6   7   >