N00b question on Py modules

2007-05-07 Thread lokesh . jagasia
Hi. Sorry to sound like a noob but that's what I am when it comes to Python. I just wrote the below module and it behaves funny. My python module: _exitcode = 0 def setExitCode(): _exitcode = 1 if __name__ == '__main__': print _exitcode setExitCode() print _exitcode Actual O/P:

Re: DiffLib Question

2007-05-07 Thread Gabriel Genellina
En Mon, 07 May 2007 00:52:18 -0300, whitewave <[EMAIL PROTECTED]> escribió: > I am currently doing the third option. Doing file.read() to both file > to be compared then feed the result to the compare function. > > Let me give you a brief sample of what I want to achieve. > > Using this code

Re: N00b question on Py modules

2007-05-07 Thread Christoph Haas
On Mon, May 07, 2007 at 12:00:38AM -0700, [EMAIL PROTECTED] wrote: > Hi. Sorry to sound like a noob but that's what I am when it comes to > Python. I just wrote the below module and it behaves funny. > > My python module: > > _exitcode = 0 > > def setExitCode(): > _exitcode = 1 > > if __nam

Re: N00b question on Py modules

2007-05-07 Thread rishi pathak
Hi this variable is local to function do this def setExitCode(): global _exitcode _exitcode = 1 On 7 May 2007 00:00:38 -0700, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: Hi. Sorry to sound like a noob but that's what I am when it comes to Python. I just wrote the below module and it behav

Re: N00b question on Py modules

2007-05-07 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, lokesh.jagasia wrote: > My python module: > > _exitcode = 0 > > def setExitCode(): > _exitcode = 1 > > if __name__ == '__main__': > print _exitcode > setExitCode() > print _exitcode > > Actual O/P: > 0 > 0 > > I expected to see an output of 0 followed b

Re: Newbie prob: How to write a file with 3 threads?

2007-05-07 Thread est
On May 7, 5:12 am, MRAB <[EMAIL PROTECTED]> wrote: > On May 6, 9:51 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:> In > <[EMAIL PROTECTED]>, est wrote: > > > I need to write a file using 3 threads simutaniously, e.g. Thread 1 > > > write the first byte of test.bin with an "a", second thr

Re: N00b question on Py modules

2007-05-07 Thread Gary Herron
[EMAIL PROTECTED] wrote: > Hi. Sorry to sound like a noob but that's what I am when it comes to > Python. I just wrote the below module and it behaves funny. > > My python module: > > _exitcode = 0 > > def setExitCode(): > _exitcode = 1 > > if __name__ == '__main__': > print _exitcode >

Re: c macros in python.

2007-05-07 Thread A.T.Hofkamp
On 2007-05-06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hey, > > I'm writing a script to generate code. I'm a bit tired of typing > outfile.write(). Does python have a way to c-like macros? Every > instance of o(...) in the code will be replaced by outfile.write(...)? Just in case you do

Re: Examples / Links needed

2007-05-07 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Andy wrote: > Gurus, I'm looking for definite examples (pardon me if I'm not clear > here) on Stack class...Somewhat like this : > > class Stack(object): > def __init__(self__) > self.__contents = [] I don't know what to tell you here without writing the t

Re: N00b question on Py modules

2007-05-07 Thread Steven D'Aprano
On Mon, 07 May 2007 00:00:38 -0700, lokesh.jagasia wrote: > I expected to see an output of 0 followed by 1. But it turns out that > the _exitcode variable is not changed at all. It seems that > setExitCode() might be editing a local copy of the _exitcode variable. Yes, that's exactly what is happ

Re: Newbie prob: How to write a file with 3 threads?

2007-05-07 Thread Gary Herron
est wrote: > On May 7, 5:12 am, MRAB <[EMAIL PROTECTED]> wrote: > >> On May 6, 9:51 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:> In >> <[EMAIL PROTECTED]>, est wrote: >> I need to write a file using 3 threads simutaniously, e.g. Thread 1 write the first byte of test.b

Re: invoke user's standard mail client

2007-05-07 Thread Gabriel Genellina
En Mon, 07 May 2007 01:52:18 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: > On May 6, 9:50 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: >> On Windows you can use MAPI. > But how? I could not find any starting point. Get the pywin32 package (Python for Windows extensions) from so

long lists

2007-05-07 Thread Merrigan
Hi All, Firstly - thank you Sean for the help and the guideline to get the size comparison, I will definitely look into this. At the moment I actually have 2 bigger issues that needs sorting... 1. I have the script popping all the files that need to be checked into a list, and have it parsing th

Re: Problem to Download ftp file

2007-05-07 Thread Gabriel Genellina
En Mon, 07 May 2007 02:27:59 -0300, Shakil Ahmed <[EMAIL PROTECTED]> escribió: > Actually i need to know that how can i download a ftp file from ncbi by > using python module ftputil. > > import ftputil > > host = ftputil.FTPHost('ftp.ncbi.nih.gov/repository/OMIM/morbidmap', > 'anonymous', 'pass

Re: default test method name in unittest framework

2007-05-07 Thread Vyacheslav Maslov
Yes, i general you are right. I meant following case, please look at my example Suppose i have following simple test case: import unittest class SomeTest(unittest.TestCase): def testAdd(self): self.assertEqual(2+2,4) if __name__=="__main__": unittest.TextTestRunner().run(SomeTest

Re: PChess 0.9

2007-05-07 Thread Brian van den Broek
majeed rana said unto the world upon 05/07/2007 01:13 AM: > I want pchess 0.9 > I want a mansion and a yacht. Unlike you, google can't help me. Brian vdB -- http://mail.python.org/mailman/listinfo/python-list

Re: default test method name in unittest framework

2007-05-07 Thread Gabriel Genellina
En Mon, 07 May 2007 04:49:12 -0300, Vyacheslav Maslov <[EMAIL PROTECTED]> escribió: > Yes, i general you are right. I meant following case, please look at my > example > > Suppose i have following simple test case: > > import unittest > > class SomeTest(unittest.TestCase): > > def testAdd(se

Re: msbin to ieee

2007-05-07 Thread revuesbio
On 7 mai, 03:52, John Machin <[EMAIL PROTECTED]> wrote: > On May 7, 7:44 am, revuesbio <[EMAIL PROTECTED]> wrote: > > > Hi > > Does anyone have the python version of the conversion from msbin to > > ieee? > > Thank u > > Yes, Google has it. Google is your friend. Ask Google. It will lead > you to s

Re: long lists

2007-05-07 Thread Steven D'Aprano
On Mon, 07 May 2007 00:28:14 -0700, Merrigan wrote: > 1. I have the script popping all the files that need to be checked into > a list, and have it parsing the list for everything...Now the problem is > this : The sever needs to check (at the moment) 375 files and eliminate > those that don't need

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 involves putting placeholders in > > your SQL strings

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

2007-05-07 Thread Stefan Sonnenberg-Carstens
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 Varrazzo >> <[EMAIL PROTECTED]> >> Every serious database driver has a >> complete and solid SQL escaping >> > mechanism. This mechanism tipical

Properties on old-style classes actually work?

2007-05-07 Thread Paul Melis
Hello, The python library docs read in section 2.1 (http://docs.python.org/lib/built-in-funcs.html): " ... property( [fget[, fset[, fdel[, doc) Return a property attribute for new-style classes (classes that derive from object). ... " But in 2.4 at least properties also seem

Re: Properties on old-style classes actually work?

2007-05-07 Thread Steven D'Aprano
On Mon, 07 May 2007 10:44:35 +0200, Paul Melis wrote: > Hello, > > The python library docs read in section 2.1 > (http://docs.python.org/lib/built-in-funcs.html): > > " > ... > > property( [fget[, fset[, fdel[, doc) > Return a property attribute for new-style classes (classes that

Re: invoke user's standard mail client

2007-05-07 Thread Paul Boddie
On 4 Mai, 18:54, [EMAIL PROTECTED] (Cameron Laird) wrote: > . > Portland > http://ct.enews.eweek.com/rd/cts?d=186-6281-53-799-798304-697089-0-0-0-1> > is the best standardization of this problem we have under Linux. > > I'll address Windows in a subsequent follow-up. Portl

Re: Properties on old-style classes actually work?

2007-05-07 Thread Nick Vatamaniuc
On May 7, 4:44 am, Paul Melis <[EMAIL PROTECTED]> wrote: > Hello, > > The python library docs read in section 2.1 > (http://docs.python.org/lib/built-in-funcs.html): > > " > ... > > property( [fget[, fset[, fdel[, doc) > Return a property attribute for new-style classes (classes that

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 Varrazzo > >> <[EMAIL PROTECTED]> >> Every serious database dri

Re: High resolution sleep (Linux)

2007-05-07 Thread Hendrik van Rooyen
"Tim Roberts" <[EMAIL PROTECTED]> wrote" > Consider what you're asking here. The operating system can only age the > timer list and re-evaluate process ready states when a process goes into > kernel mode, either by releasing the CPU or hitting the end of its time > slice. In order to know that

matplotlib: howto redraw figure automatically, without stop in show()/draw()?

2007-05-07 Thread dmitrey
Hi all, here is a question already mentioned below, and I'm also interested in that one very much. unfortunatly, I can't write anything to matplotlib mailing lists because I constantly get server internal error (500) Does anyone knows the answer? (howto redraw figure automatically (for example upda

Custom software development

2007-05-07 Thread VB
iTechArt Group - Custom Software Development and Offshore outsourcing Company http://www.itechart.com/ Offshore custom software development company iTechArt - Web site and Content Management Solutions development, CMS consulting: Ektron, Drupal and DotNetNuke iTechArt Group provides high quality

Bastion/rexec use cases?

2007-05-07 Thread Paul Miller
Bastion and rexec have been deprecated since Python 2.2, so it seems we (the Python community) have gotten along well enough without them. Have these modules not been reimplemented because: a) There are no valid use cases for them. b) Doing so would be difficult and prone to breakage as new featur

assisging multiple values to a element in dictionary

2007-05-07 Thread saif . shakeel
Hi, I have a dictionary which is something like this: id_lookup={ 16:'subfunction', 26:'dataId', 34:'parameterId', 39:'subfunction', 44:'dataPackageId', 45:'parameterId', 54:'subfunction', 59:'dataId', 165:'subfunction', 169:'subfunction', 170:'dataPackageId', 174:'controlParameterId' }

Re: N00b question on Py modules

2007-05-07 Thread lokesh . jagasia
Thanks a lot for the responses ppl. Python's treatment of global variables was an eye-opener. I have coded in Java & C/C++ in the past and there the behaviour is diametrically opposite. Cheers -- http://mail.python.org/mailman/listinfo/python-list

Re: invoke user's standard mail client

2007-05-07 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Cameron Laird <[EMAIL PROTECTED]> wrote: >In article <[EMAIL PROTECTED]>, >[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >>Hello, >> >>the simplest way to launch the user's standard mail client from a >>Python program is by creating a mailto: URL and launching the >>w

Re: assisging multiple values to a element in dictionary

2007-05-07 Thread Nick Vatamaniuc
On May 7, 7:03 am, [EMAIL PROTECTED] wrote: > Hi, >I have a dictionary which is something like this: > id_lookup={ > 16:'subfunction', > 26:'dataId', > 34:'parameterId', > 39:'subfunction', > 44:'dataPackageId', > 45:'parameterId', > 54:'subfunction', > 59:'dataId', > 165:'subfunction', > 1

Re: msbin to ieee

2007-05-07 Thread John Machin
On May 7, 6:18 pm, revuesbio <[EMAIL PROTECTED]> wrote: > On 7 mai, 03:52, John Machin <[EMAIL PROTECTED]> wrote: > > > On May 7, 7:44 am, revuesbio <[EMAIL PROTECTED]> wrote: > > > > Hi > > > Does anyone have the python version of the conversion from msbin to > > > ieee? > > > Thank u > > > Yes, G

Re: Basic question about sockets and security

2007-05-07 Thread Steve Holden
Dave Dean wrote: > Hi all, > I'm just starting out in sockets/network programming, and I have a very > basic question...what are the 'security' implications of opening up a > socket? For example, suppose I've written a simple chat server and chat > client. The server opens a socket, listens

Re: assisging multiple values to a element in dictionary

2007-05-07 Thread Vyacheslav Maslov
>I have a dictionary which is something like this: > id_lookup={ > 16:'subfunction', > 26:'dataId', > 34:'parameterId', > 39:'subfunction', > 44:'dataPackageId', > 45:'parameterId', > 54:'subfunction', > 59:'dataId', > 165:'subfunction', > 169:'subfunction', > 170:'dataPackageId', > 174:'co

Re: Basic question about sockets and security

2007-05-07 Thread Steve Holden
Dave Dean wrote: [socket security inquiry] One further point: everything I wrote for server sockets applies to client sockets too if there's a possibility they are interacting with a server that's been maliciously coded, or compromised in some way by an attacker. regards Steve -- Steve Hold

Re: CGI python use "under a curse"

2007-05-07 Thread Steve Holden
Adrian Smith wrote: > On May 7, 2:30 pm, Steven D'Aprano > <[EMAIL PROTECTED]> wrote: >> On Sun, 06 May 2007 21:30:16 -0700, Adrian Smith wrote: > >> It is NOT the same error. There are NO syntax errors in the script, there >> is a runtime error. The so-called administrator is wrong: you can't use

Re: Bastion/rexec use cases?

2007-05-07 Thread Steve Holden
Paul Miller wrote: > Bastion and rexec have been deprecated since Python 2.2, so it seems > we (the Python community) have gotten along well enough without them. > Have these modules not been reimplemented because: > > a) There are no valid use cases for them. > b) Doing so would be difficult and

Re: msbin to ieee

2007-05-07 Thread revuesbio
On 7 mai, 13:21, John Machin <[EMAIL PROTECTED]> wrote: > On May 7, 6:18 pm, revuesbio <[EMAIL PROTECTED]> wrote: > > > > > On 7 mai, 03:52, John Machin <[EMAIL PROTECTED]> wrote: > > > > On May 7, 7:44 am, revuesbio <[EMAIL PROTECTED]> wrote: > > > > > Hi > > > > Does anyone have the python versio

Re: Bastion/rexec use cases?

2007-05-07 Thread Duncan Booth
Paul Miller <[EMAIL PROTECTED]> wrote: > Bastion and rexec have been deprecated since Python 2.2, so it seems > we (the Python community) have gotten along well enough without them. > Have these modules not been reimplemented because: > > a) There are no valid use cases for them. > b) Doing so wo

Re: long lists

2007-05-07 Thread Merrigan
On May 7, 10:18 am, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Mon, 07 May 2007 00:28:14 -0700, Merrigan wrote: > > 1. I have the script popping all the files that need to be checked into > > a list, and have it parsing the list for everything...Now the problem is > > this : The sever needs to

Re: matplotlib: howto redraw figure automatically, without stop in show()/draw()?

2007-05-07 Thread WEINHANDL Herbert
dmitrey wrote: > Hi all, > here is a question already mentioned below, and I'm also interested in > that one very much. > unfortunatly, I can't write anything to matplotlib mailing lists > because I constantly get server internal error (500) > Does anyone knows the answer? maybe this is what you w

Re: Bastion/rexec use cases?

2007-05-07 Thread Paul Boddie
On 7 Mai, 14:01, Duncan Booth <[EMAIL PROTECTED]> wrote: > Paul Miller <[EMAIL PROTECTED]> wrote: > > Bastion and rexec have been deprecated since Python 2.2, so it seems > > we (the Python community) have gotten along well enough without them. > > Have these modules not been reimplemented because:

Re: Plot with scipy

2007-05-07 Thread [EMAIL PROTECTED]
On 4 Mai, 15:57, redcic <[EMAIL PROTECTED]> wrote: > I've already got this package. I just wanted to try something new. > > However, since you talk about it, I've got a question regarding this > package. The execution of the code stops after the line: > pylab.show() > which is off course the last l

Re: assisging multiple values to a element in dictionary

2007-05-07 Thread Carsten Haese
On Mon, 2007-05-07 at 04:03 -0700, [EMAIL PROTECTED] wrote: > Hi, >I have a dictionary which is something like this: > id_lookup={ > 16:'subfunction', > 26:'dataId', > 34:'parameterId', > 39:'subfunction', > 44:'dataPackageId', > 45:'parameterId', > 54:'subfunction', > 59:'dataId', > 165:'s

Re: long lists

2007-05-07 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Merrigan wrote: > The Script it available at this url : > http://www.lewendewoord.co.za/theScript.py > > P.S. I know it looks like crap, but I'm a n00b, and not yet through > the OOP part of the tutorial. One spot of really horrible runtime is the `comp_are()` function,

Re: assisging multiple values to a element in dictionary

2007-05-07 Thread John Machin
On May 7, 10:59 pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Mon, 2007-05-07 at 04:03 -0700, [EMAIL PROTECTED] wrote: > > Hi, > >I have a dictionary which is something like this: > > id_lookup={ > > 16:'subfunction', > > 26:'dataId', > > 34:'parameterId', > > 39:'subfunction', > > 44:'

Re: assisging multiple values to a element in dictionary

2007-05-07 Thread Carsten Haese
On Mon, 2007-05-07 at 06:06 -0700, John Machin wrote: > Unlikely. "Turning it around" produces one key ('subfunction') with > *FIVE* different values. Whoops! I assumed the OP's problem was reasonably well-formed and didn't actually check if any of the values were duplicated. I guess the OP will j

how do you implement a reactor without a select?

2007-05-07 Thread Michele Simionato
I have always been curious about how people implement mainloops (or, in Twisted terminology, reactors). So I sit down and I wrote the following simple implementation: import itertools class SimpleReactor(object): DELAY = 0.001 # seconds def __init__(self): self._event = {} # act

Can Python Parse an MS SQL Trace?

2007-05-07 Thread kyosohma
Hi All, Can Python parse a trace file created with MS SQL's profiler? There are a few thousand lines in the trace file and I need to find the insert statements and the stored procedures. Unfortunately, I am not an SQL guru and was hoping Python could help. Any pointers are appreciated. Thanks!

Re: adding methods at runtime and lambda

2007-05-07 Thread Mike
On May 4, 5:46 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > Mike wrote: > > I just realized in working with this more that the issues I was having > > with instancemethod and other things seems to be tied solely to > > What you describe below is a function that happens to be an attribute of an > in

Re: Can Python Parse an MS SQL Trace?

2007-05-07 Thread Tim Golden
[EMAIL PROTECTED] wrote: > Can Python parse a trace file created with MS SQL's profiler? There > are a few thousand lines in the trace file and I need to find the > insert statements and the stored procedures. Unfortunately, I am not > an SQL guru and was hoping Python could help. > Mike Mike, C

Re: How do I use the config parser?

2007-05-07 Thread Larry Bates
[EMAIL PROTECTED] wrote: > Hi, > I need a specific example. I have seen the docs, but I don't all the > stuffs there. > > So basically, I need my config file to be created and read by my > script. > > Here is a snippet > > # read old actions > from ConfigParser import ConfigParser > > fp = open

Re: msbin to ieee

2007-05-07 Thread revuesbio
On 7 mai, 14:56, John Machin <[EMAIL PROTECTED]> wrote: > On May 7, 10:00 pm, revuesbio <[EMAIL PROTECTED]> wrote: > > > > > On 7 mai, 13:21, John Machin <[EMAIL PROTECTED]> wrote: > > > > On May 7, 6:18 pm, revuesbio <[EMAIL PROTECTED]> wrote: > > > > > On 7 mai, 03:52, John Machin <[EMAIL PROTECT

Re: Getting some element from sets.Set

2007-05-07 Thread Andrew McLean
[EMAIL PROTECTED] wrote: > In the particular case, I have to read an attribute from any one of > the elements, which one doesn't matter because this attribute value is > same across all elements in the set. Someone else pointed out that there might be better data structures. If performance was no

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

2007-05-07 Thread Stefan Sonnenberg-Carstens
On Mo, 7.05.2007, 11:32, Daniele Varrazzo wrote: > 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: Getting some element from sets.Set

2007-05-07 Thread Christopher Arndt
On 4 Mai, 10:23, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > It is not possible to index set objects. That is OK. > > > But, what if I want to find some element from the Set. > > In the particular case, I have to read an attribute from any one of > the elements, which one doesn't matter be

RE: Strange terminal behavior after quitting Tkinter application

2007-05-07 Thread Hamilton, William
> From: Chris > > I'll admit to being surprised at seeing a claim that a tkinter > > application, started within an interactive session, without a mainloop, > > even runs... I could see it maybe happening from Idle, since Idle is > > running a tkinter mainloop, so the application bindings m

Re: msbin to ieee

2007-05-07 Thread John Machin
On May 7, 10:00 pm, revuesbio <[EMAIL PROTECTED]> wrote: > On 7 mai, 13:21, John Machin <[EMAIL PROTECTED]> wrote: > > > > > On May 7, 6:18 pm, revuesbio <[EMAIL PROTECTED]> wrote: > > > > On 7 mai, 03:52, John Machin <[EMAIL PROTECTED]> wrote: > > > > > On May 7, 7:44 am, revuesbio <[EMAIL PROTECT

Re: how do you implement a reactor without a select?

2007-05-07 Thread Diez B. Roggisch
> Notice that I copied the Twisted terminology, but > I did not look at Twisted implementation because I did not want to > use a select (I assume that the GUI mainloops do not use it either). Why do you assume that? It's a wrong assumption. Yielding a thread/process until the OS wakes it up becaus

Re: Can Python Parse an MS SQL Trace?

2007-05-07 Thread kyosohma
On May 7, 8:34 am, Tim Golden <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Can Python parse a trace file created with MS SQL's profiler? There > > are a few thousand lines in the trace file and I need to find the > > insert statements and the stored procedures. Unfortunately, I am not

Unittest Automation

2007-05-07 Thread Calvin Spealman
I'm trying to find a better way, a shell one-liner, that I can use to recurse through my project, find all my test_ modules, aggregate the TestCase classes into a suite, and run all my tests. Basically, what py.test does out of the box. Why am I having such trouble doing it? -- Read my blog! I de

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 Stefan Sonnenberg-Carstens
On Mo, 7.05.2007, 16:26, Daniele Varrazzo wrote: >> >> >> > 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 pyt

Re: how do you implement a reactor without a select?

2007-05-07 Thread Alex Martelli
Michele Simionato <[EMAIL PROTECTED]> wrote: > I wonder if real mainloops are done in this way and how bad/good is > this implementation compared to a serious one. Any suggestion/hint/ > advice is well appreciated. Thanks, Module sched in Python's standard library may suggest one clearly-better a

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 Carsten Haese
On Mon, 2007-05-07 at 07:26 -0700, Daniele Varrazzo wrote: > > >> >> > 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

Re: BUSTED!!! 100% VIDEO EVIDENCE that WTC7 was controlled demolition!! NEW FOOTAGE!!! Ask yourself WHY havn't I seen this footage before?

2007-05-07 Thread James Beck
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > On Sat, 05 May 2007 07:54:50 +0100, Eeyore > <[EMAIL PROTECTED]> wrote: > > > > > > >quasi wrote: > > > >> Gib Bogle wrote: > >> > >> >Ah, so the firefighters were in on the conspiracy! > >> > >> No, but the firefighters are very much aw

Recommended validating XML parser?

2007-05-07 Thread Kirk Strauser
We're looking for a current, supported, validating XML parser. Since it seems like there are a few thousand out there, I though we'd see what everyone else is using. Bonus points if it can do something like: >>> foo = XMLParser(""" 3000 """, dtd=file('/etc/weightfile.dt

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

2007-05-07 Thread Stefan Sonnenberg-Carstens
On Mo, 7.05.2007, 16:50, Carsten Haese wrote: > On Mon, 2007-05-07 at 07:26 -0700, Daniele Varrazzo wrote: >> > >> >> > cur.execute("INSERT INTO datatable (data) VALUES (%s);", >> > >> >> > (pickled_data,)) >> >> > %s is not a placeholder IMHO. >> >> > What happens when using %s is, that the st

Re: how do you implement a reactor without a select?

2007-05-07 Thread Michele Simionato
On May 7, 4:39 pm, [EMAIL PROTECTED] (Alex Martelli) wrote: > Michele Simionato <[EMAIL PROTECTED]> wrote: > > I wonder if real mainloops are done in this way and how bad/good is > > this implementation compared to a serious one. Any suggestion/hint/ > > advice is well appreciated. Thanks, > > Modu

SkimpyGimpy PNG canvas w/ Javascript mouse tracking

2007-05-07 Thread aaronwmail-usenet
ANN: SkimpyGimpy PNG canvas has Javascript mouse tracking The SkimpyGimpy PNG image canvas now can generate Javascript data structures which allow HTML pages to intelligently respond to mouse events over the image. Please read about the SkimpyGimpy Canvas and look at the mouse tracking example he

Re: Recommended validating XML parser?

2007-05-07 Thread Stefan Behnel
Kirk Strauser wrote: > We're looking for a current, supported, validating XML parser. Since it > seems like there are a few thousand out there, I though we'd see what > everyone else is using. You are asking for lxml, right? http://codespeak.net/lxml/ > Bonus points if it can do something like

Re: ftplib acting weird

2007-05-07 Thread Carlos Hanson
On May 4, 3:43 am, Merrigan <[EMAIL PROTECTED]> wrote: > Hi All, > > I have written a little script to upload some files to an ftp folder. > The problem is as follows : > > I wrote the script on my windows laptop, and I want to run it from > mylinux server. Everything worked fine so I uploaded it t

Re: c macros in python.

2007-05-07 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Amaury Forgeot d'Arc <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] a écrit : >> Hey, >> >> I'm writing a script to generate code. I'm a bit tired of typing >> outfile.write(). Does python have a way to c-like macros? Every >> instance of o(...) in the code will

Python-URL! - weekly Python news and links (May 7)

2007-05-07 Thread Cameron Laird
QOTW: "As a general rule, *ALL* multithread operations are at least that troublesome, and most are far more so." - Gary Herron "I'm a recent, belated convert from Perl. I work in a physics lab and have been using Python to automate a lot of measurement equipment lately. It works fabulously for

building python from source on HP

2007-05-07 Thread Edwin . Madari
appreciate hints or pointers for building python on HP. running 'make test' fails with following cryptic message, after running configure, & make. Attempting to build python from source on HP-UX B.11.11 U 9000/800 3314646674 unlimited-user license *** Error exit code 1 Stop. not sure if out

Re: long lists

2007-05-07 Thread half . italian
On May 7, 5:14 am, Merrigan <[EMAIL PROTECTED]> wrote: > On May 7, 10:18 am, Steven D'Aprano > > > > <[EMAIL PROTECTED]> wrote: > > On Mon, 07 May 2007 00:28:14 -0700, Merrigan wrote: > > > 1. I have the script popping all the files that need to be checked into > > > a list, and have it parsing the

Latest errors on pickled objects and blob datatypes in mysql

2007-05-07 Thread krishnakant Mane
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 both. my table is called testobj and the blob field is called obj. now f

getmtime differs between Py2.5 and Py2.4

2007-05-07 Thread Josef Dalcolmo
I tried this on Windows only: In Python 2.4 os.path.getmtime returned the local time, in Python 2.5 it seems to return GMT: import os, time print ctime.time(os.path.getmtime(foo)) differs on Python 2.4 and Python 2.5 by the timezone. Now, the implementation of the two stat calls differs on Win

Re: how do you implement a reactor without a select?

2007-05-07 Thread [EMAIL PROTECTED]
Michele Simionato wrote: > Notice that I copied the Twisted terminology, but > I did not look at Twisted implementation because I did not want to > use a select (I assume that the GUI mainloops do not use it either). > The trick I use is to store the actions to perform (which are > callables identi

After the Deletion of Google Answers, . U Got Questions Fills the Gap Answering and Asking the Tough Questions

2007-05-07 Thread Leisure . 208
My friend asked some tough questions http://ugotquestions.blogspot.com/2007_05_01_archive.html unlike yahoo answers ( Which Generates Content with Answers ) U got questions picks only the best, Real Person Questions.,yeah so there is this second book called E.T. and the BOOK OF THE GREEN PLANET...

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: Unittest Automation

2007-05-07 Thread bourbaki
On May 7, 7:29 am, "Calvin Spealman" <[EMAIL PROTECTED]> wrote: > I'm trying to find a better way, a shell one-liner, that I can use to > recurse through my project, find all my test_ modules, aggregate the > TestCase classes into a suite, and run all my tests. Basically, what > py.test does out of

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

Simulating simple electric circuits

2007-05-07 Thread Bjoern Schliessmann
Hello all, I'm trying to simulate simple electric logic (asynchronous) circuits. By "simple" I mean that I only want to know if I have "current" or "no current" (it's quite digital) and the only elements need to be (with some level of abstraction to my specific problem) - sources (here begin curr

SOAPpy parameters in sequence

2007-05-07 Thread D Unit
Hi, I am trying to send a message to a SOAP implementation where the parameters must in sequence. I am creating a SOAPProxy and then sending the message with: proxy.methodName(paramName=value, paramName2=value2) Is there a way to explicitly set the order of parameters? If not, is there a way to

Re: Simulating simple electric circuits

2007-05-07 Thread Arnaud Delobelle
On May 7, 7:05 pm, Bjoern Schliessmann wrote: > Hello all, > > I'm trying to simulate simple electric logic (asynchronous) > circuits. By "simple" I mean that I only want to know if I > have "current" or "no current" (it's quite digital) and the only > elements need to be (with some level of abstr

Re: SOAPpy parameters in sequence

2007-05-07 Thread D Unit
I figured it out. The SOAPPRoxy class has an attribute 'SOAPPRoxy.config.argsOrdering' You can set it to a dict. Each key is the name of a method, and the value is a list with the attributes in the correct order. -Dave D Unit wrote: > > Hi, > > I am trying to send a message to a SOAP implemen

is for reliable?

2007-05-07 Thread [EMAIL PROTECTED]
Hi to all I have a question about the for statement of python. I have the following piece of code where cachefilesSet is a set that contains the names of 1398 html files cached on my hard disk for fn in cachefilesSet: fObj = codecs.open( baseDir + fn + '-header.html', 'r', 'iso-8859-1' )

Re: Simulating simple electric circuits

2007-05-07 Thread Bjoern Schliessmann
Arnaud Delobelle wrote: > On May 7, 7:05 pm, Bjoern Schliessmann > There is a master "current controller" object which tells >> the "source" object to start a "current" by calling its >> neighbour. The calls traverse the network until they reach a >> "ground" object. Specifically, the source passes

randomly write to a file

2007-05-07 Thread rohit
hi, i am developing a desktop search.For the index of the files i have developed an algorithm with which i should be able to read and write to a line if i know its line number. i can read a specified line by using the module linecache but i am struck as to how to implement writing to the n(th) lin

Re: Simulating simple electric circuits

2007-05-07 Thread Terry Reedy
"Bjoern Schliessmann" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hello all, | I'm trying to simulate simple electric logic (asynchronous)circuits. [snip] Some network simulators use connection objects in addition to node objects, with connections joined to nodes but not the sa

Re: is for reliable?

2007-05-07 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > Hi to all I have a question about the for statement of python. I have the > following piece of code where cachefilesSet is a set that contains the > names of 1398 html files cached on my hard disk > > [snipped code] > > this code stops at the 47

Re: is for reliable?

2007-05-07 Thread Jerry Hill
On 5/7/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > for fn in cachefilesSet: ... > this code stops at the 473th file instead of reaching 1398 This is often caused by mutating the object you are iterating over inside the for loop. I didn't see anything in the code you posted that would do th

Re: BUSTED!!! 100% VIDEO EVIDENCE that WTC7 was controlled demolition!! NEW FOOTAGE!!! Ask yourself WHY havn't I seen this footage before?

2007-05-07 Thread quasi
On Mon, 7 May 2007 10:55:55 -0400, James Beck <[EMAIL PROTECTED]> wrote: >In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] >says... >> On Sat, 05 May 2007 07:54:50 +0100, Eeyore >> <[EMAIL PROTECTED]> wrote: >> >> > >> > >> >quasi wrote: >> > >> >> Gib Bogle wrote: >> >> >> >> >Ah, so the firef

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

2007-05-07 Thread Gabriel Genellina
En Mon, 07 May 2007 14:08:21 -0300, krishnakant Mane <[EMAIL PROTECTED]> escribió: > my table is called testobj and the blob field is called obj. > now following is my query with the cursor named CSRInsert. > CSRInsert.execute("insert into testobj (obj) values > (?);",(pickled_object)) > the e

Re: long lists

2007-05-07 Thread Gabriel Genellina
En Mon, 07 May 2007 09:14:34 -0300, Merrigan <[EMAIL PROTECTED]> escribió: > The Script it available at this url : > http://www.lewendewoord.co.za/theScript.py I understand this as a learning exercise, since there are lot of utilities for remote syncing. Some comments: - use os.path.join t

  1   2   >