Re: Latest errors on pickled objects and blob datatypes in mysql

2007-05-07 Thread Daniele Varrazzo
On 7 Mag, 19:08, "krishnakant Mane" <[EMAIL PROTECTED]> wrote: > hello, > finally the errors for my sql query have changed so I have even > changed the thread subject because I feel now that this is not doable > in mysql and this seams to be a bug, ither in python or the MySQLdb > module or perhaps

Re: Latest errors on pickled objects and blob datatypes in mysql

2007-05-07 Thread Daniele Varrazzo
On 7 Mag, 19:08, "krishnakant Mane" <[EMAIL PROTECTED]> wrote: > hello, > finally the errors for my sql query have changed so I have even > changed the thread subject because I feel now that this is not doable > in mysql and this seams to be a bug, ither in python or the MySQLdb > module or perhaps

Re: problem with quoted strings while inserting into varchar field of database.

2007-05-07 Thread Daniele Varrazzo
> Ashes on my head. My fault: the difference is hard to spot indeed in the rather long line of the example. I should have been more explicit stating that the differences were: 1. missing explicit quotes around the placeholders (they are part of the escaped values), 2. no % operator: two parame

Re: problem with quoted strings while inserting into varchar field of database.

2007-05-07 Thread Daniele Varrazzo
> >> >> > cur.execute("INSERT INTO datatable (data) VALUES (%s);", > >> >> > (pickled_data,)) > %s is not a placeholder IMHO. > What happens when using %s is, that the string given will be inserted where > %s is; that is something python does as with every print or such. It is indeed. The be

Re: problem with quoted strings while inserting into varchar field of database.

2007-05-07 Thread Daniele Varrazzo
On 7 Mag, 10:46, "Stefan Sonnenberg-Carstens" <[EMAIL PROTECTED]> wrote: > On Mo, 7.05.2007, 10:30, Daniele Varrazzo wrote: > > > On 7 Mag, 08:55, "krishnakant Mane" <[EMAIL PROTECTED]> wrote: > >> On 6 May 2007 11:22:52 -0700, Daniele Varraz

Re: problem with quoted strings while inserting into varchar field of database.

2007-05-07 Thread Daniele Varrazzo
On 7 Mag, 08:55, "krishnakant Mane" <[EMAIL PROTECTED]> wrote: > On 6 May 2007 11:22:52 -0700, Daniele Varrazzo <[EMAIL PROTECTED]> >> Every > serious database driver has a complete and solid SQL escaping > > mechanism. This mechanism tipically invol

Re: problem with quoted strings while inserting into varchar field of database.

2007-05-06 Thread Daniele Varrazzo
> I further discovered that the string variable that contains the > pickled object contains a lot of single quots "'" and this is what is > probably preventing the sql insert from succedding. can some one > suggest how to work around this problem? Every serious database driver has a complete and

Re: Finding and copying files with python.

2007-04-03 Thread Daniele Varrazzo
> > > I wish to copy the highest version number of a file from directory \ > > > \ > > > \fileserver\D:\scripts to C:\scripts where the file names are of the > > > form > > > > filename_MM.NN.SS.zip, where MM, NN, and SS can be one to three > > > digits. > > > > Example directory: > > > other.zip

Re: Help needed on config files

2007-01-31 Thread Daniele Varrazzo
On Jan 31, 11:04 am, "jvdb" <[EMAIL PROTECTED]> wrote: > Hi there, > > I am quite new on python programming and need some help on solving my > problem.. > > I have to make a (python) program which deletes files from > directories. I don't think deleting, etc. is the problem. The problem > is that t

Re: Is it possible to fasten the import of cgi?

2007-01-18 Thread Daniele Varrazzo
Cecil Westerhof wrote: > I have a cgi-script dat uses the modules cgi, os, sys and time. Offcourse I > can not time the time used to import time, but os and sys do not take more > as a millisecond. My script itself takes 3 or 4 milliseconds. But importing > cgi takes 95 milliseconds. (This is on my

Re: One more regular expressions question

2007-01-18 Thread Daniele Varrazzo
Victor Polukcht wrote: > Great thanks. > > You post helped me so much! > > My resulting regexp is: > "(?P^(.*)\s*)\(((?P\d+))\)\s+((?P\d+))" Notice that this way you are including trailing whitespaces in the var1 group. You may want to put the "\s*" outside the parenthesis. mmm... in this case yo

Re: One more regular expressions question

2007-01-18 Thread Daniele Varrazzo
Victor Polukcht wrote: > I have a couple of strings like: > > Unassigned Number (1)32 [...] > Interworking, unspecified (127) 5 > > I need to get: > Error code (value in brackets) - Value - Message. > > My actual problem is i can't get ho

Re: Benchmarking Python's subroutines/function

2006-10-03 Thread Daniele Varrazzo
Wijaya Edward ha scritto: > Hi, > > How does one benchmark > multiple subroutines in Python? > Is there a built-in library for that? the timeit module, and the Python profile for a deeper insight. See "The Python Profiler" in the Python Library Reference. > > -- > Regards, > Edward WIJAYA > SIN