Module import path when embedding python in C

2008-09-26 Thread graph
Per http://mail.python.org/pipermail/python-list/2008-September/506206.html something like this (plus error handling) seems to be the right way to add to sys.path when embedding python in C: PyObject *sys_path = PySys_GetObject("path"); PyObject *path = PyString_FromString("/your/path"); PyList_Ap

Re: deleting an object

2008-09-26 Thread Terry Reedy
Karl Kobata wrote: Please help. Questions based on snippet of code below. Please post code that works. Use cut and paste. 1) when myTestCase is deleted, is just the pointer deleted or the entire instance with all of its data and data structure deleted? Have you read the manual secti

Re: Writing a well-behaved daemon

2008-09-26 Thread Ben Finney
Sean DiZazzo <[EMAIL PROTECTED]> writes: > Looks like somebody did the same thing I did and posted it. > > http://svn.plone.org/svn/collective/bda.daemon/trunk/bda/daemon/daemon.py Thanks, I've not seen that before. It still seems loony to me that something this difficult to do right, yet so si

Re: SimpleXMLRPCServer -- turning off request log?

2008-09-26 Thread Vinay Sajip
On Sep 26, 2:01 am, [EMAIL PROTECTED] wrote: > My SimpleXMLRPCServer program prints to stderr a line like > this for each request: > > ohm..pixar.com - - [25/Sep/2008 17:57:50] "POST /RPC2 HTTP/1.0" 200 - > > Is there a way to turn thisloggingoff? I have RTFM and can't > seem to find a way to do s

Re: what does "python -i" use as input stream (stdin)?

2008-09-26 Thread Almar Klein
> > Use subprocess.PIPE > Usually the tricky part is to figure out exactly whether there is more > input or not. With Python it's easy, use the ps1 prompt. Thanks, but that is not exactly what I meant. (Maybe my question was a bit vague). I want to replace the input stream of the *remote* process

Re: What do you call a class not intended to be instantiated

2008-09-26 Thread Steven D'Aprano
On Thu, 25 Sep 2008 21:17:14 -0700, Aahz wrote: > Seems to me that if all the module is used for is to store state, you're > wasting a file on disk. I personally prefer to use a class singleton. I don't recognise the term "class singleton". Can you explain please? How is it different from an or

Re: How to get the filename in the right case ?

2008-09-26 Thread Steven D'Aprano
On Fri, 26 Sep 2008 01:46:15 +0200, Stef Mientki wrote: > Secondly thoughtless copying of current behavior, doesn't bring any > progress, > and I think that's one of the reasons why we're still burdened by > inventions done 20 years ago, > e.g. "do you want to save your changes ?". I click No abo

Re: Not fully OO ?

2008-09-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Aaron "Castironpi" Brady wrote: > Wikipedia puts it decently: "mainly for OO programming, but with some > procedural elements." "Procedural" is the opposite of "functional", not "object-oriented". -- http://mail.python.org/mailman/listinfo/python-list

Re: Time.sleep(0.0125) not available within Linux

2008-09-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Steven D'Aprano wrote: > On Wed, 24 Sep 2008 22:18:05 +1200, Lawrence D'Oliveiro wrote: > >> Just a thought, your minimum sleep time is probably limited by the >> resolution of the system "HZ" clock. Type >> >> less /proc/config.gz > > $ less /proc/config.gz

Re: [Tkinter] how to keep a window above all other OS windows?

2008-09-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Dennis Lee Bieber wrote: > {I miss the Amiga -- > where one had the option to push a window to the back /without/ losing > focus... made it useful for reading one window while touch-typing data > into the "hidden" window} This sort of thing should be configurable i

Re: Python style: exceptions vs. sys.exit()

2008-09-26 Thread Bruno Desthuilliers
Ross Ridge a écrit : Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: Also note that there are quite a couples cases where the library authors themselves cannot predict which exception types may be raised - as soon as the library functions expect callback functions, file-like or dict-like or wh

Re: Not fully OO ?

2008-09-26 Thread Bruno Desthuilliers
Lawrence D'Oliveiro a écrit : In message <[EMAIL PROTECTED]>, Aaron "Castironpi" Brady wrote: Wikipedia puts it decently: "mainly for OO programming, but with some procedural elements." "Procedural" is the opposite of "functional", not "object-oriented". AFAIK, the "opposite" if functional

Re: Module import path when embedding python in C

2008-09-26 Thread Christian Heimes
graph wrote: Does anyone know why PySys_GetObject wasn't documented until somewhat recently (http://bugs.python.org/issue1245) if it has been part of the system module interface since at least Python 1.5.2? Is it not supposed to be used? What's the difference the above and importing the sys mod

urllib.urlopen fails in Emacs

2008-09-26 Thread Iain Dalton
In Emacs, using run-python, import urllib urllib.urlopen('http://www.google.com/') results in this traceback: Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.5/urllib.py", line 82, in urlopen return opener.open(url) File "/usr/

Re: Not fully OO ?

2008-09-26 Thread Steven D'Aprano
On Fri, 26 Sep 2008 09:58:39 +0200, Bruno Desthuilliers wrote: >> "Procedural" is the opposite of "functional", not "object-oriented". > > AFAIK, the "opposite" if functional is imperative, not procedural. But > let's not waste too much time on terminology arguments... We're not wasting time on

Re: Time.sleep(0.0125) not available within Linux

2008-09-26 Thread Steven D'Aprano
On Fri, 26 Sep 2008 19:46:10 +1200, Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Steven D'Aprano > wrote: > >> On Wed, 24 Sep 2008 22:18:05 +1200, Lawrence D'Oliveiro wrote: >> >>> Just a thought, your minimum sleep time is probably limited by the >>> resolution of the system "HZ

test list post

2008-09-26 Thread Derek Martin
Sorry for the noise, my recent posts seem to have been eaten by the list management software, as far as I can tell. Just testing if that's still the case. -- Derek D. Martin http://www.pizzashack.org/ GPG Key ID: 0x81CFE75D pgp611hi0GmSx.pgp Description: PGP signature -- http://mail.python.or

Re: How to read a jpg bytearray from a Flash AS3 file

2008-09-26 Thread Kay Schluehr
On 26 Sep., 08:47, [EMAIL PROTECTED] wrote: > I'm trying to save an image from a Flash AS3 to my server as a jpg > file. I found some PHP code to do this, but I want to do this in > Python. I'd expect you use AS3 to save the image file ( just looking at Adobes AS3 docs on how this works ) and load

Re: multiprocessing eats memory

2008-09-26 Thread redbaron
On 26 сент, 04:20, Istvan Albert <[EMAIL PROTECTED]> wrote: > On Sep 25, 8:40 am, "Max Ivanov" <[EMAIL PROTECTED]> wrote: > > > At any time in main process there are shouldn't be no more than two copies > > of data > > (one original data and one result). > > From the looks of it you are storing a

urgent

2008-09-26 Thread delhi institute of management & services
Delhi Institute of Management & Services Dear friends, We are extremely happy to welcome you to the world of Management... We are in the process of preparing some 5 minutes revision Q & A type lessons for management students. They are in no way, a replacement for the classroom lectures, textbooks

Re: cups.Connection.printFile

2008-09-26 Thread Antoon Pardon
On 2008-09-16, Graham Jenkins <[EMAIL PROTECTED]> wrote: > > I'm trying to print a file from within a Python program. > > The quick-and-dirty solution is to use something like: > > fd = os.popen("lp -d MyPrinter", "wb") > fd.write(MyFileContents) > > But it seems to me that there should be a cl

Re: flock trouble

2008-09-26 Thread Antoon Pardon
On 2008-09-08, Seb <[EMAIL PROTECTED]> wrote: > I'm trying to implement a file server using the code below. However > the locking doesn't work. I can delete while put'ing a file. > > Anyone got an idea about why? > [code snipped] As far as I understand you are writing some kind of server. What is

Re: How to kill threading.Thread instance?

2008-09-26 Thread Antoon Pardon
On 2008-09-21, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Diez B. Roggisch wrote: > >>> I wonder why something like myThread.exit() or myThread.quit() or >>> threading.kill(myThread) can't be implemented? >>> Is something like that present in Python 3000? >> >> Not that I'm aware of it (which does

Re: Time.sleep(0.0125) not available within Linux

2008-09-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Steven D'Aprano wrote: > On Fri, 26 Sep 2008 19:46:10 +1200, Lawrence D'Oliveiro wrote: > >> In message <[EMAIL PROTECTED]>, Steven D'Aprano >> wrote: >> >>> On Wed, 24 Sep 2008 22:18:05 +1200, Lawrence D'Oliveiro wrote: >>> Just a thought, your minimum slee

how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread bcurtu
Hi, I have a BIG problem with the next query: cursor.execute(""" SELECT titem.object_id, titem.tag_id FROM tagging_taggeditem titem WHERE titem.object_id IN (%s) """,( eid_list)) eid_list is suppossed to be a

Re: Time.sleep(0.0125) not available within Linux

2008-09-26 Thread jkn
On Sep 26, 9:26 am, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Fri, 26 Sep 2008 19:46:10 +1200, Lawrence D'Oliveiro wrote: > > In message <[EMAIL PROTECTED]>, Steven D'Aprano > > wrote: > > >> On Wed, 24 Sep 2008 22:18:05 +1200, Lawrence D'Oliveiro wrote: > > >>> Just a thought, your minimum s

Re: How to parse a string completely into a list

2008-09-26 Thread Tino Wildenhain
[EMAIL PROTECTED] wrote: ... Ahh, but I forgot to mention that I have to mark the path I took in the string. So using list() and then join() are my best options. Still you would not need to create a list out of the string on your way. Just append the stepstone chars to a new list during your w

Re: Python is slow?

2008-09-26 Thread sturlamolden
On Sep 26, 5:45 am, "David Cournapeau" <[EMAIL PROTECTED]> wrote: > I am fairly experienced in matlab (have been using it extensively for > 5 years in academical context), and now with numpy, and generally, > they are comparable speed-wise. Matlab has some niceties which makes > it faster in some

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread Wojtek Walczak
On Fri, 26 Sep 2008 02:32:50 -0700 (PDT), bcurtu wrote: > I have a BIG problem with the next query: > > cursor.execute(""" > SELECT titem.object_id, titem.tag_id > FROM tagging_taggeditem titem > WHERE titem.object_id IN (%s)

Re: urllib.urlopen fails in Emacs

2008-09-26 Thread Wojtek Walczak
On Fri, 26 Sep 2008 02:23:18 -0600, Iain Dalton wrote: > In Emacs, using run-python, > > import urllib > urllib.urlopen('http://www.google.com/') > > results in this traceback: ... > IOError: [Errno socket error] (111, 'Connection refused') > > It works fine from the command line. Why

Re: problem updating variable in a module

2008-09-26 Thread Tim Rowe
2008/9/24 Terry Reedy <[EMAIL PROTECTED]>: > With the mod/mod1 mixup fixed, you do not need the update function. > mod.a = 20 > should do the same thing. I was assuming that the update function was just to illustrate the access problem the writer was having. I think the chances are the problem i

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread bcurtu
Pardon? % instead of %s? It doesn't work... :( On 26 sep, 12:15, Wojtek Walczak <[EMAIL PROTECTED]> wrote: > On Fri, 26 Sep 2008 02:32:50 -0700 (PDT), bcurtu wrote: > > I have a BIG problem with the next query: > > >         cursor.execute(""" > >                     SELECT titem.object_id,

Building truth tables

2008-09-26 Thread andrea
Well I would like to make a little program that given a certain logical expression gives the complete truth table. It's not too difficult in fact, I just have some doubts on how to design it. I thought something like that: class Term: class Table: def and(... def or(... But I'm not con

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread Bruno Desthuilliers
Wojtek Walczak a écrit : On Fri, 26 Sep 2008 02:32:50 -0700 (PDT), bcurtu wrote: I have a BIG problem with the next query: cursor.execute(""" SELECT titem.object_id, titem.tag_id FROM tagging_taggeditem titem WHERE titem.o

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread Bruno Desthuilliers
bcurtu a écrit : Hi, I have a BIG problem with the next query: cursor.execute(""" SELECT titem.object_id, titem.tag_id FROM tagging_taggeditem titem WHERE titem.object_id IN (%s) """,( eid_list)) eid_list i

Re: urllib.urlopen fails in Emacs

2008-09-26 Thread Niklas Norrthon
On 26 Sep, 12:21, Wojtek Walczak <[EMAIL PROTECTED]> wrote: > On Fri, 26 Sep 2008 02:23:18 -0600, Iain Dalton wrote: > > InEmacs, using run-python, > > >     import urllib > >    urllib.urlopen('http://www.google.com/') > > > results in this traceback: > ... > >     IOError: [Errno socket error] (1

Laptops- Read Features of branded Laptops

2008-09-26 Thread Online Shopping
Notebook computers - buy latest and best low price laptops from online computer shop in India, homeshop18.com offers low price laptops from online laptops shop. To know more visit: http://www.homeshop18.com/shop/u/y/c-Computers-Q-and-Q-Peripherals-S-Laptops/Home_Online-clI_2-cI_920-pCI_909- -- http

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread Tino Wildenhain
Hi, Bruno Desthuilliers wrote: bcurtu a écrit : Hi, I have a BIG problem with the next query: cursor.execute(""" SELECT titem.object_id, titem.tag_id FROM tagging_taggeditem titem WHERE titem.object_id IN (%s)

Re: Not fully OO ?

2008-09-26 Thread Tino Wildenhain
Hi, Tim Rowe wrote: 2008/9/23 Craig Allen <[EMAIL PROTECTED]>: So python may turn out to be pure OO ... The question I usually ask is "Does this language help me get the job done?" Python often does. That's all that really matters, isn't it? Well then it still depends on the perception of

Re: is decorator the right thing to use?

2008-09-26 Thread Bruno Desthuilliers
Dmitry S. Makovey a écrit : (snip) I never used metaclasses before and decorators seemed to be bit more straight-forward to me :) ..oh well. Don't be afraid !-) While it's true that they can be a bit confusing at first, metaclasses are just classes - whose instances happens to be classes the

Are spams on comp.lang.python a major nuisance?

2008-09-26 Thread skip
I took over spam filter management for the python.org mailing lists a couple months ago and made a few changes to the way the spam filter is trained. Things seem to be at a reasonable level as far as I can tell (I see a few spams leak through each day), though I wasn't actively reading comp.lang.p

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread Michael Mabin
cursor.execute(""" SELECT titem.object_id, titem.tag_id FROM tagging_taggeditem titem WHERE titem.object_id IN (%s) """ % ','.join([str(x) for x in [1,5,9]]) On Fri, Sep 26, 2008 at 6:23 AM, Tino Wildenhain <[EMAIL PROT

Re: how to keep a window above all other OS windows?

2008-09-26 Thread MRAB
On Sep 26, 10:04 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Fri, 26 Sep 2008 19:52:59 +1200, Lawrence D'Oliveiro > <[EMAIL PROTECTED]> declaimed the following in > comp.lang.python: > > > > > This sort of thing should be configurable in many X11-based window managers. > >         Maybe..

Re: multiprocessing eats memory

2008-09-26 Thread MRAB
On Sep 26, 9:52 am, redbaron <[EMAIL PROTECTED]> wrote: > On 26 ÓÅÎÔ, 04:20, Istvan Albert <[EMAIL PROTECTED]> wrote: > > > On Sep 25, 8:40šam, "Max Ivanov" <[EMAIL PROTECTED]> wrote: > > > > At any time in main process there are shouldn't be no more than two > > > copies of data > > > (one origin

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread Tino Wildenhain
Michael Mabin wrote: cursor.execute(""" SELECT titem.object_id, titem.tag_id FROM tagging_taggeditem titem WHERE titem.object_id IN (%s) """ % ','.join([str(x) for x in [1,5,9]]) Nope. That would be dangerous! -> goo

how to search multiple textfiles ?

2008-09-26 Thread Stef Mientki
hello, I want to search multiple textfiles (python source files) for a specific word. I can find all files, open them and do a search, but I guess that will be rather slow. I couldn't find any relevant information through google. Does anyone know of a search library that performs this task fa

Re: Are spams on comp.lang.python a major nuisance?

2008-09-26 Thread Matt Nordhoff
[EMAIL PROTECTED] wrote: > I took over spam filter management for the python.org mailing lists a couple > months ago and made a few changes to the way the spam filter is trained. > Things seem to be at a reasonable level as far as I can tell (I see a few > spams leak through each day), though I was

Re: how to search multiple textfiles ?

2008-09-26 Thread Mike Driscoll
On Sep 26, 8:35 am, Stef Mientki <[EMAIL PROTECTED]> wrote: > hello, > > I want to search multiple textfiles (python source files) for a specific > word. > I can find all files, open them and do a search, > but I guess that will be rather slow. > > I couldn't find any relevant information through

Re: how to search multiple textfiles ?

2008-09-26 Thread George Sakkis
On Sep 26, 9:35 am, Stef Mientki <[EMAIL PROTECTED]> wrote: > hello, > > I want to search multiple textfiles (python source files) for a specific > word. > I can find all files, open them and do a search, > but I guess that will be rather slow. > > I couldn't find any relevant information through

Re: cups.Connection.printFile

2008-09-26 Thread Mike Driscoll
On Sep 19, 9:01 am, Antoon Pardon <[EMAIL PROTECTED]> wrote: > On 2008-09-16, Graham Jenkins <[EMAIL PROTECTED]> wrote: > > > > > I'm trying to print a file from within a Python program. > > > The quick-and-dirty solution is to use something like: > > > fd = os.popen("lp -d MyPrinter", "wb") > > fd

Re: how to search multiple textfiles ?

2008-09-26 Thread M�ta-MCI (MVP)
Hi! On Windows, you can use the (standard) command findstr Example: findstr /n /s /I strsearched *.py @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: is decorator the right thing to use?

2008-09-26 Thread Paul McGuire
On Sep 25, 10:41 am, "Dmitry S. Makovey" <[EMAIL PROTECTED]> wrote: > Diez B. Roggisch wrote: > > Dmitry S. Makovey schrieb: > >> Dmitry S. Makovey wrote: > >>> In my real-life case A is a proxy to B, C and D instances/objects, not > >>> just one. > > >> forgot to mention that above would mean that

Re: Fastest way to max() list

2008-09-26 Thread David Di Biase
Hi Chris, Yeah I hear you on point A. but this the specification I was given, so I have to follow it unfortunately. I've also been restricted and not allowed to use any other packages. I was using NumPy earlier (should have mentioned that) but I was wondering if there was a simpler way. Is NumPy t

Re: Python is slow?

2008-09-26 Thread Fly Away
> Matlab's strongest side is data visualization though. Although we have > matplotlib, mayavi and possibility of interfacing with gnuplot, it's > not anywhere near the capabilities of Matlab. What particular Matlab visualization features are you referring to? I can't think of anything that would

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread Michael Mabin
I laugh in the face of danger. Give me a use case for an exploit. On Fri, Sep 26, 2008 at 8:05 AM, Tino Wildenhain <[EMAIL PROTECTED]> wrote: > Michael Mabin wrote: > >> cursor.execute(""" >> SELECT titem.object_id, titem.tag_id >> FROM tagging_taggedite

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread Benjamin Kaplan
On Fri, Sep 26, 2008 at 10:38 AM, Michael Mabin <[EMAIL PROTECTED]> wrote: > I laugh in the face of danger. > > Give me a use case for an exploit. > http://xkcd.com/327/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Not fully OO ?

2008-09-26 Thread Patrick Mullen
Depending on the scale of the website I am making, how much I care about editing it in the future, and how much I just want to get something up, I will occasionally use php. And I am a self confessed php hater :) But it's generally the fastest way I know to get something up. So even terrible lan

Understanding (and getting rid) of optparse.py:668: FutureWarning: %u/%o/%x/%X of negative int will return a

2008-09-26 Thread hofer
Hi, I get following warning with a python script: optparse.py:668: FutureWarning: %u/%o/%x/%X of negative int will return a signed string in Python 2.4 and up my code: from optparse import OptionParser if __name__ == '__main__': parser = OptionParser() parser.add_option('-G','--green'

Re: Not fully OO ?

2008-09-26 Thread Bruno Desthuilliers
Patrick Mullen a écrit : Depending on the scale of the website I am making, how much I care about editing it in the future, and how much I just want to get something up, I will occasionally use php. And I am a self confessed php hater :) But it's generally the fastest way I know to get somethi

Re: multiprocessing eats memory

2008-09-26 Thread redbaron
On 26 сент, 17:03, MRAB <[EMAIL PROTECTED]> wrote: > On Sep 26, 9:52 am, redbaron <[EMAIL PROTECTED]> wrote: > > > On 26 ÓÅÎÔ, 04:20, Istvan Albert <[EMAIL PROTECTED]> wrote: > > > > On Sep 25, 8:40šam, "Max Ivanov" <[EMAIL PROTECTED]> wrote: > > > > > At any time in main process there are shouldn'

Re: Not fully OO ?

2008-09-26 Thread Steven D'Aprano
On Fri, 26 Sep 2008 17:00:59 +0200, Bruno Desthuilliers wrote: > Patrick Mullen a écrit : >> Depending on the scale of the website I am making, how much I care >> about editing it in the future, and how much I just want to get >> something up, I will occasionally use php. And I am a self confess

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread Tino Wildenhain
Michael Mabin wrote: I laugh in the face of danger. Give me a use case for an exploit. (see below) On Fri, Sep 26, 2008 at 8:05 AM, Tino Wildenhain <[EMAIL PROTECTED] > wrote: Michael Mabin wrote: cursor.execute("""

Re: Are spams on comp.lang.python a major nuisance?

2008-09-26 Thread Steven D'Aprano
On Fri, 26 Sep 2008 06:31:40 -0500, skip wrote: > I took over spam filter management for the python.org mailing lists a > couple months ago and made a few changes to the way the spam filter is > trained. Things seem to be at a reasonable level as far as I can tell (I > see a few spams leak through

lxml question

2008-09-26 Thread Uwe Schmitt
Hi, I have to parse some text which pretends to be XML. lxml does not want to parse it, because it lacks a root element. I think that this situation is not unusual, so: is there a way to force lxml to parse it ? My work around is wrapping the text with "..." before feeding lxmls parser. Greeting

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread MRAB
On Sep 26, 12:23 pm, Tino Wildenhain <[EMAIL PROTECTED]> wrote: > Hi, > > > > Bruno Desthuilliers wrote: > > bcurtu a écrit : > >> Hi, > > >> I have a BIG problem with the next query: > > >>         cursor.execute(""" > >>                     SELECT titem.object_id, titem.tag_id > >>          

Large Data Sets: Use base variables or classes? And some binding questions

2008-09-26 Thread Patrick Sullivan
Hello. I will be using some large data sets ("points" from 2 to 12 variables) and would like to use one class for each point rather than a list or dictionary. I imagine this is terribly inefficient, but how much? What is the cost of creating a new class? What is the cost of referencing a class v

Re: is decorator the right thing to use?

2008-09-26 Thread Dmitry S. Makovey
Paul McGuire wrote: >> see, in your code you're assuming that there's only 1 property ( 'b' ) >> inside of A that needs proxying. In reality I have several. > > No, really, Diez has posted the canonical Proxy form in Python, using > __getattr__ on the proxy, and then redirecting to the contained

Re: Time.sleep(0.0125) not available within Linux

2008-09-26 Thread Grant Edwards
On 2008-09-26, Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > In message <[EMAIL PROTECTED]>, Steven D'Aprano > wrote: > >> On Wed, 24 Sep 2008 22:18:05 +1200, Lawrence D'Oliveiro wrote: >> >>> Just a thought, your minimum sleep time is probably limited by the >>> resolution of the system "HZ" c

Re: Are spams on comp.lang.python a major nuisance?

2008-09-26 Thread MRAB
On Sep 26, 4:13 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Fri, 26 Sep 2008 06:31:40 -0500, skip wrote: > > I took over spam filter management for the python.org mailing lists a > > couple months ago and made a few changes to the way the spam filter is > > trained. Thing

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread Michael Mabin
So we can drop a table in an in clause? How is this a use case. Cartoons are funny but actual proof that this example using an in-clause provides an exploit would be more helpful I think. On Fri, Sep 26, 2008 at 9:50 AM, Benjamin Kaplan <[EMAIL PROTECTED]>wrote: > > > On Fri, Sep 26, 2008 at 1

Re: Understanding (and getting rid) of optparse.py:668: FutureWarning: %u/%o/%x/%X of negative int will return a

2008-09-26 Thread Peter Otten
hofer wrote: > Hi, > > I get following warning with a python script: > > > optparse.py:668: FutureWarning: %u/%o/%x/%X of negative int will > return a signed string in Python 2.4 and up > > > my code: > from optparse import OptionParser > > if __name__ == '__main__': > parser = OptionPar

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread D'Arcy J.M. Cain
On Fri, 26 Sep 2008 11:00:59 -0500 "Michael Mabin" <[EMAIL PROTECTED]> wrote: > So we can drop a table in an in clause? How is this a use case. Cartoons > are funny but actual proof that this example using an in-clause provides an > exploit would be more helpful I think. I'm not sure what proof

Re: Building truth tables

2008-09-26 Thread Tim Rowe
2008/9/26 andrea <[EMAIL PROTECTED]>: > Well I would like to make a little program that given a certain > logical expression gives the complete truth table. > > It's not too difficult in fact, I just have some doubts on how to > design it. > > I thought something like that: > > class Term: > > clas

Re: Are spams on comp.lang.python a major nuisance?

2008-09-26 Thread Tim Rowe
2008/9/26 Steven D'Aprano <[EMAIL PROTECTED]>: > I don't have any objective numbers, but subjectively it seems to me that > the number of spams is significantly higher, but not so high as to be a > major nuisance. I consider *any* spam to be a major nuisance, but I don't see them as being the fau

Re: Time.sleep(0.0125) not available within Linux

2008-09-26 Thread Edel SM
helllo, On Fri, Sep 26, 2008 at 3:46 PM, Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > In message <[EMAIL PROTECTED]>, Steven D'Aprano > wrote: > >> On Wed, 24 Sep 2008 22:18:05 +1200, Lawrence D'Oliveiro wrote: >> >>> Just a thought, your minimum sleep time is probably limited by the >>> resol

Re: Not fully OO ?

2008-09-26 Thread Tim Rowe
2008/9/26 Tino Wildenhain <[EMAIL PROTECTED]>: >> The question I usually ask is "Does this language help me get the job >> done?" Python often does. That's all that really matters, isn't it? > > Well then it still depends on the perception of "job done". For example > PHP programmers would bet the

Re: lxml question

2008-09-26 Thread Mark Thomas
On Sep 26, 11:19 am, Uwe Schmitt <[EMAIL PROTECTED]> wrote: > I have to parse some text which pretends to be XML. lxml does not want > to parse it, because it lacks a root element. > I think that this situation is not unusual, so: is there a way to > force lxml to parse it ? By "pretends to be XML

Re: How to get the filename in the right case ?

2008-09-26 Thread Stef Mientki
Steven D'Aprano wrote: On Fri, 26 Sep 2008 01:46:15 +0200, Stef Mientki wrote: Secondly thoughtless copying of current behavior, doesn't bring any progress, and I think that's one of the reasons why we're still burdened by inventions done 20 years ago, e.g. "do you want to save your changes

Re: how to search multiple textfiles ?

2008-09-26 Thread Paul Rubin
Stef Mientki <[EMAIL PROTECTED]> writes: > Does anyone know of a search library that performs this task fast ? You mean you want a Python search engine (with inverted indexes and all that)? Try: nucular.sf.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Quick sort implementation in python

2008-09-26 Thread Alex Snast
On Sep 25, 11:47 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > Now as you can see I'm passing my list object to both functions along > > with their first, last indices > > I cannot really see that. More specifically, it isn't definite what the > type of the "a" argument is, nor does the spec

Re: Understanding (and getting rid) of optparse.py:668: FutureWarning: %u/%o/%x/%X of negative int will return a

2008-09-26 Thread hofer
On Sep 26, 6:21 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > hofer wrote: > > Hi, > > > I get following warning with a python script: > > > optparse.py:668: FutureWarning: %u/%o/%x/%X of negative int will > > return a signed string in Python 2.4 and up > > You can print options.__dict__ instead of

Matplotlib Polar Plot Angles/Axes

2008-09-26 Thread afrogazer
I am creating a wind rose using a polar bar plot bu the points do not seem to align to the correct angles. Here is the sample code I am using. I can't seem to see anything in the API on how to set the angles. Any ideas anybody? Thanks. from pylab import * angles = arange(0,360,45) data = [18, 1

Re: is decorator the right thing to use?

2008-09-26 Thread Aaron "Castironpi" Brady
On Sep 26, 10:41 am, "Dmitry S. Makovey" <[EMAIL PROTECTED]> wrote: > Paul McGuire wrote: > > If you need to get fancier and support this single-proxy-to-multiple- > > delegates form, then yes, you will need some kind of map that says > > which method should delegate to which object.  Or, if it is

Re: Building truth tables

2008-09-26 Thread Aaron "Castironpi" Brady
On Sep 26, 11:40 am, "Tim Rowe" <[EMAIL PROTECTED]> wrote: > 2008/9/26 andrea <[EMAIL PROTECTED]>: > > > Well I would like to make a little program that given a certain > > logical expression gives the complete truth table. > > > It's not too difficult in fact, I just have some doubts on how to > >

Re: Are spams on comp.lang.python a major nuisance?

2008-09-26 Thread Aaron "Castironpi" Brady
On Sep 26, 11:43 am, "Tim Rowe" <[EMAIL PROTECTED]> wrote: > 2008/9/26 Steven D'Aprano <[EMAIL PROTECTED]>: > > > I don't have any objective numbers, but subjectively it seems to me that > > the number of spams is significantly higher, but not so high as to be a > > major nuisance. > > I consider *

Re: Fastest way to max() list

2008-09-26 Thread Chris Rebert
On Fri, Sep 26, 2008 at 7:22 AM, David Di Biase <[EMAIL PROTECTED]> wrote: > Hi Chris, > > Yeah I hear you on point A. but this the specification I was given, so I > have to follow it unfortunately. I've also been restricted and not allowed > to use any other packages. I was using NumPy earlier (sh

Re: Not fully OO ?

2008-09-26 Thread Aaron "Castironpi" Brady
On Sep 26, 11:48 am, "Tim Rowe" <[EMAIL PROTECTED]> wrote: > 2008/9/26 Tino Wildenhain <[EMAIL PROTECTED]>: > > >> The question I usually ask is "Does this language help me get the job > >> done?" Python often does. That's all that really matters, isn't it? > > > Well then it still depends on the

Re: Writing a well-behaved daemon

2008-09-26 Thread Sean DiZazzo
On Sep 26, 12:13 am, Ben Finney <[EMAIL PROTECTED]> wrote: > Sean DiZazzo <[EMAIL PROTECTED]> writes: > > Looks like somebody did the same thing I did and posted it. > > >http://svn.plone.org/svn/collective/bda.daemon/trunk/bda/daemon/daemo... > > Thanks, I've not seen that before. > > It still see

Re: how to search multiple textfiles ?

2008-09-26 Thread Sean DiZazzo
On Sep 26, 6:35 am, Stef Mientki <[EMAIL PROTECTED]> wrote: > hello, > > I want to search multiple textfiles (python source files) for a specific > word. > I can find all files, open them and do a search, > but I guess that will be rather slow. > > I couldn't find any relevant information through

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread Michael Mabin
Doesn't it depend on where and why you intend to execute the code? Obviously some SQL is more at risk for exploit when the input is from the screen on a web page than if you were running parameterized code in a controlled batch environment. Or if you were writing code generators (which is what I h

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread Paul Boddie
On 26 Sep, 12:15, Wojtek Walczak <[EMAIL PROTECTED]> wrote: > On Fri, 26 Sep 2008 02:32:50 -0700 (PDT), bcurtu wrote: > > I have a BIG problem with the next query: > > > cursor.execute(""" > > SELECT titem.object_id, titem.tag_id > > FROM tagging_

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread Jean-Paul Calderone
On Fri, 26 Sep 2008 14:04:35 -0500, Michael Mabin <[EMAIL PROTECTED]> wrote: Doesn't it depend on where and why you intend to execute the code? Obviously some SQL is more at risk for exploit when the input is from the screen on a web page than if you were running parameterized code in a controlle

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread D'Arcy J.M. Cain
On Fri, 26 Sep 2008 14:04:35 -0500 "Michael Mabin" <[EMAIL PROTECTED]> wrote: > Doesn't it depend on where and why you intend to execute the code? > Obviously some SQL is more at risk for exploit when the input is from the > screen on a web page than if you were running parameterized code in a > co

Re: Test if list contains another list

2008-09-26 Thread Derek Martin
On Thu, Sep 18, 2008 at 03:24:16AM -0700, [EMAIL PROTECTED] wrote: > I looked inside this thread for my query which brought me the > following google search result > "Test if list contains another list - comp.lang.python | Google > Groups" > > But then I was disappointed to see the question asked

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-26 Thread Benjamin Kaplan
On Fri, Sep 26, 2008 at 3:04 PM, Michael Mabin <[EMAIL PROTECTED]> wrote: > Doesn't it depend on where and why you intend to execute the code? > Obviously some SQL is more at risk for exploit when the input is from the > screen on a web page than if you were running parameterized code in a > contr

Re: Python is slow?

2008-09-26 Thread James Matthews
+1 QOTW... On Tue, Sep 23, 2008 at 7:13 AM, George Sakkis <[EMAIL PROTECTED]>wrote: > On Sep 23, 9:57 am, Grant Edwards <[EMAIL PROTECTED]> wrote: > > > On 2008-09-23, sturlamolden <[EMAIL PROTECTED]> wrote: > > > > [...] > > > > > After having a working Python prototype, I resorted to rewrite th

ConfigParser subclass problem

2008-09-26 Thread Strato
Hi folks, I think I do something wrong, but I don't see why it doesn't work, so I will explain: I've searched in the list archive and found this thread, that explain exactly what I want to have: the options strings returned by ConfigParser without being lower cased. I tryed to reproduce th

Re: Matplotlib Polar Plot Angles/Axes

2008-09-26 Thread Bas
I only have experience with the matlab version of polar, but my wild guess is that you have convert your degrees to radians. Go to the Matplotlib newsgroup if you need any better help. HTH, Bas -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple processes, private working directories

2008-09-26 Thread Michael Palmer
On Sep 25, 8:16 am, "Tim Arnold" <[EMAIL PROTECTED]> wrote: > "Tim Arnold" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > >I have a bunch of processes to run and each one needs its own working > > directory. I'd also like to know when all of the processes are > > finished. > >

Re: Fastest way to max() list

2008-09-26 Thread David Di Biase
Yeah, Apologies, it's been a long day for me. It works, just have to check if the nazis I'm doing this for will allow me to use object and NumPy. ack. Thanks again, Dave On Fri, Sep 26, 2008 at 2:08 PM, Chris Rebert <[EMAIL PROTECTED]> wrote: > On Fri, Sep 26, 2008 at 7:22 AM, David Di Biase <

  1   2   >