Re: is this data structure build-in or I'll have to write my own class?

2008-02-27 Thread Jorge Vargas
On Wed, Feb 20, 2008 at 12:07 PM, thebjorn <[EMAIL PROTECTED]> wrote: > On Feb 20, 3:32 pm, "Jorge Vargas" <[EMAIL PROTECTED]> wrote: > > > On Feb 20, 2008 8:15 AM, Larry Bates <[EMAIL PROTECTED]> wrote: > > > > > Jorge Vargas wrote: > > > > I need a data structure that will let me do: > > > >

Re: is this data structure build-in or I'll have to write my own class?

2008-02-27 Thread Jorge Vargas
On Wed, Feb 20, 2008 at 7:34 PM, Carl Banks <[EMAIL PROTECTED]> wrote: > On Feb 20, 8:12 am, "Jorge Vargas" <[EMAIL PROTECTED]> wrote: > > I need a data structure that will let me do: > > > > - attribute access (or index) > > - maintain the order (for iter and print) > > - be mutable. > > >

Re: is this data structure build-in or I'll have to write my own class?

2008-02-27 Thread Jorge Vargas
On Thu, Feb 21, 2008 at 2:52 AM, Robert Bossy <[EMAIL PROTECTED]> wrote: > mkPyVS wrote: > > This isn't so optimal but I think accomplishes what you desire to some > > extent... I *think* there is some hidden gem in inheriting from dict > > or an mapping type that is cleaner than what I've shown

Re: How, python with Tk extensions enabled to import Tkinter

2008-02-27 Thread Diez B. Roggisch
Murat Gunduz wrote: > > > Dear list member, > > I am using a Linux machine (Fedora Core 7, 64 bit): > Linux 2.6.21-1.3228.fc7 #1 SMP Tue Jun 12 14:56:37 EDT 2007 x86_64 So you are under linux... > 4- type "./configure --enable-framework And now you try to create an OSX-framework-build? Why so

Re: Documentation - which format

2008-02-27 Thread grflanagan
On Feb 26, 11:47 pm, Jumping Arne <[EMAIL PROTECTED]> wrote: > I'm considering using plain text file for documenting certain things (nothing > to do with Python) and I'm looking at different "formatting systems" ... > preferable with a python implementation to render the text at least as HTML - > p

time.time() strangeness

2008-02-27 Thread Nitro
Ok, my final solution is to add the D3DCREATE_FPU_PRESERVE flag. It didn't harm performance in a noticeable way at all. I was under the impression SSE would be affected by this, too. Additionally I was under the impression that float precision would suffice for time.time(). Obviously I was

Re: is there enough information?

2008-02-27 Thread Gabriel Genellina
En Wed, 27 Feb 2008 06:25:25 -0200, Dennis Lee Bieber <[EMAIL PROTECTED]> escribió: > On Wed, 27 Feb 2008 05:46:56 -0200, "Gabriel Genellina" > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > >> It's like a McDonalds: three guys (the producers) are taking orders from >> the

Re: How, python with Tk extensions enabled to import Tkinter

2008-02-27 Thread Martin Franklin
Murat Gunduz wrote: > > Dear list member, > > I am using a Linux machine (Fedora Core 7, 64 bit): > Linux 2.6.21-1.3228.fc7 #1 SMP Tue Jun 12 14:56:37 EDT 2007 x86_64 > Fedora ships ready built Tk/Tcl and Tkinter RPM's so use the Package Updater (search for tkinter) or command line 'yum install

Logging to HTTP or File

2008-02-27 Thread Robert Rawlins - Think Blue
Hello Chaps, I'm after some advice on the best way to handle a logging job. Essentially I have data which I'm looking to log to a webservice, it would make good sense I think to use something like the HTTP handler for the python logging API. The problem comes when the application isn't 'onl

Re: Logging to HTTP or File

2008-02-27 Thread Jorge Vargas
On Wed, Feb 27, 2008 at 4:16 AM, Robert Rawlins - Think Blue <[EMAIL PROTECTED]> wrote: > > > > > Hello Chaps, > > > > I'm after some advice on the best way to handle a logging job. Essentially I > have data which I'm looking to log to a webservice, it would make good sense > I think to use somethi

Re: library

2008-02-27 Thread Jorge Vargas
On Tue, Feb 26, 2008 at 11:24 PM, Raj kumar <[EMAIL PROTECTED]> wrote: > > hi, > how to open python api documetation in linux machine? $ python import help(module|object|whatever) > i think there should be a way to open installed library as a HTML pages. > pydoc -p > Thanks in advance. > > > _

Re: Adobe CS3

2008-02-27 Thread Dotan Cohen
On 26/02/2008, Tobiah <[EMAIL PROTECTED]> wrote: > But then again, when just adding a quip to a long thread in which > the readers have already seen the previous comments, top posting > can be an advantage to the reader. You had to quote my message _five_times_ to get that point across? Dotan C

Re: is there enough information?

2008-02-27 Thread castironpi
On Feb 26, 11:45 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > Warning -- long post follows > > On Tue, 26 Feb 2008 12:17:54 -0800, Dennis Lee Bieber > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > > >Which is, it seems, totally backwards... Also... to my k

Re: How to pass shell variable to shell script from python

2008-02-27 Thread Christian Heimes
Rockins Chen wrote: > Hi all, > > I encountered a problem: I have a python script, let's just name it > caller.py, It calls a shell script, which is named callee.sh. In callee.sh, > it need a shell variable $target, which should be supplied by caller.py(cannot > pass by argument). I try to use os.

macro in python

2008-02-27 Thread bharath venkatesh
hi .. how to create macro in python for set of instruction that is done frequently but too less in number to ignore the overhead of function call ... -- http://mail.python.org/mailman/listinfo/python-list

Re: Documentation - which format

2008-02-27 Thread Christian Heimes
Ben Finney wrote: > Yes, TTBOMK. The site hasn't been updated for a while, but I follow > the mailing list and activity continues on the code itself. Python 2.6 and newer are using reST for documentation, see http://docs.python.org/dev/ Christian -- http://mail.python.org/mailman/listinfo/pyth

Re: How to pass shell variable to shell script from python

2008-02-27 Thread Gerardo Herzig
Rockins Chen wrote: >Hi all, > >I encountered a problem: I have a python script, let's just name it >caller.py, It calls a shell script, which is named callee.sh. In callee.sh, >it need a shell variable $target, which should be supplied by caller.py(cannot >pass by argument). I try to use os.envir

refreshing the cache time of a key

2008-02-27 Thread bharath venkatesh
hi .. is it possible to refresh the cache time of a key with out having to retrieving the cached data and storing it back in memcache .. for example if a data is cached for 1 hour and at the 50th minute from the time this data has been cached i want to store it in the cache for 1 more hou

Re: __getattribute__ meta class?

2008-02-27 Thread Carl Banks
On Feb 27, 12:44 am, "bambam" <[EMAIL PROTECTED]> wrote: > In retrospect, the project has three parts: remove > side effects, push side effects to a common location, modify code so that > changes only affect areas that encapsulate side effects. This code allows > top level code to pretend that the

BaseHTTPServer and do_POST method

2008-02-27 Thread rocksportrocker
Hi, I am trying to implement a local server for storing and retrieving numerical data. So I used BaseHTTPServer as follows: from BaseHTTPServer import * class Handler(BaseHTTPRequestHandler): def do_POST(self): print "POST" self.send_response(200) httpd = HTTPServer(("",8

Re: Python-URL! - weekly Python news and links (Feb 18)

2008-02-27 Thread Peter Otten
Piet van Oostrum wrote: >> "Gabriel Genellina" <[EMAIL PROTECTED]> (GG) wrote: > >>GG> "Given this indispensable process and architecture issue, isn't it >>obvious GG> that it's totally irrelevant to the system's overall safety >>whether the GG> compiler has performed the further smattering o

Re: BaseHTTPServer and do_POST method

2008-02-27 Thread rocksportrocker
On Feb 27, 1:28 pm, rocksportrocker <[EMAIL PROTECTED]> wrote: > Hi, > > I am trying to implement a local server for storing and retrieving > numerical data. > So I used BaseHTTPServer as follows: > > from BaseHTTPServer import * > > class Handler(BaseHTTPRequestHandler): > > def do_POST(self):

Re: How to pass shell variable to shell script from python

2008-02-27 Thread Philipp Pagel
Gerardo Herzig <[EMAIL PROTECTED]> wrote: > Rockins Chen wrote: > Well, if you have to use os.system, that could be > os.system("export target=localhost.localdomain.org; ./callee.sh") Or os.system("env target=localhost.localdomain.org ./callee.sh") cu Philipp -- Dr. Philipp Pagel Lehrst

Why this ref leak?

2008-02-27 Thread Gerhard Häring
import sys def foo(): class C(object): pass foo() print ">>", sys.gettotalrefcount() foo() print ">>", sys.gettotalrefcount() foo() print ">>", sys.gettotalrefcount() >> 21366 >> 21387 >> 21408 [9779 refs] Both Python 2.4 and 2.5 don't clean up properly here. Why is this? Aren

Re: Documentation - which format

2008-02-27 Thread Wildemar Wildenburger
[EMAIL PROTECTED] wrote: > Definitely ReST. See http://rst2a.com/ > Hey, this is sweet! Thanks for that. /W -- http://mail.python.org/mailman/listinfo/python-list

Re: object identity and hashing

2008-02-27 Thread castironpi
On Feb 25, 7:44 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On Feb 24, 9:28 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > > >> [1]http://www.martinfowler.com/eaaCatalog/identityMap.html > > > [1] illustrates a case in which 'a is a' returns False, and in the > > other

BaseHTTPServer and do_POST method

2008-02-27 Thread rocksportrocker
Hi, I am trying to implement a local server for storing and retrieving numerical data. So I use BaseHTTPServer as follows: - from BaseHTTPServer import * class Handler(BaseHTTPRequestHandler): def do_POST(self):

Re: Official IRC channel for Python?

2008-02-27 Thread js
> You can't join #python on freenode without identifying with nickserv > first. Why is that? I can join #perl, #php, #ruby, #mysql, #postgres without registration. What advantage does it have? and the advantage really worth? If #python were the developer's room, I'd say it's reasonable, but that

Re: Python-URL! - weekly Python news and links (Feb 18)

2008-02-27 Thread Piet van Oostrum
> "Gabriel Genellina" <[EMAIL PROTECTED]> (GG) wrote: >GG> "Given this indispensable process and architecture issue, isn't it obvious >GG> that it's totally irrelevant to the system's overall safety whether the >GG> compiler has performed the further smattering of semantically puny >GG> 'verif

Re: Why this ref leak?

2008-02-27 Thread Thomas Heller
Gerhard Häring schrieb: > import sys > > def foo(): > class C(object): > pass > > foo() > print ">>", sys.gettotalrefcount() > foo() > print ">>", sys.gettotalrefcount() > foo() > print ">>", sys.gettotalrefcount() > > >> 21366 > >> 21387 > >> 21408 > [9779 refs] > > Both Pytho

Re: time.time() strangeness

2008-02-27 Thread Roel Schroeven
Nitro schreef: > Ok, my final solution is to add the D3DCREATE_FPU_PRESERVE flag. It didn't > harm performance in a noticeable way at all. I was under the impression > SSE would be affected by this, too. Additionally I was under the > impression that float precision would suffice for time.tim

Re: Portable linux python install

2008-02-27 Thread Martin Schmitz
Am 26.02.08 schrieb "Mike M" <[EMAIL PROTECTED]>: > I have a python application which I'd like to distribute to thousands > of machines in our server farm. Install everything you need on the oldest box available and package it with PyInstaller (http://pyinstaller.python-hosting.com/). Then you get

Re: macro in python

2008-02-27 Thread Guilherme Polo
2008/2/27, bharath venkatesh <[EMAIL PROTECTED]>: > hi .. > how to create macro in python for set of instruction that is done > frequently but too less in number to ignore the overhead of function call > ... > > -- > http://mail.python.org/mailman/listinfo/python-list > There is lambda, not e

Re: Official IRC channel for Python?

2008-02-27 Thread Guilherme Polo
2008/2/27, js <[EMAIL PROTECTED]>: > > You can't join #python on freenode without identifying with nickserv > > first. > > > Why is that? > I can join #perl, #php, #ruby, #mysql, #postgres without registration. > What advantage does it have? and the advantage really worth? > The direct benefit

Re: Why this ref leak?

2008-02-27 Thread Peter Otten
Gerhard Häring wrote: > import sys > > def foo(): > class C(object): > pass > > foo() > print ">>", sys.gettotalrefcount() > foo() > print ">>", sys.gettotalrefcount() > foo() > print ">>", sys.gettotalrefcount() > > >> 21366 > >> 21387 > >> 21408 > [9779 refs] > > Both Python

Re: Why this ref leak?

2008-02-27 Thread Peter Otten
Bjoern Schliessmann wrote: > BTW, where is your method sys.gettotalrefcount supposed to come > from? My CPython doesn't have it. It's in the debug build only. Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Why this ref leak?

2008-02-27 Thread Bjoern Schliessmann
Gerhard Häring wrote: > Both Python 2.4 and 2.5 don't clean up properly here. Why is this? > Aren't classes supposed to be garbage-collected? Yes, but not neccessarily immediately. BTW, where is your method sys.gettotalrefcount supposed to come from? My CPython doesn't have it. Regards, Björn

Re: Why this ref leak?

2008-02-27 Thread Peter Otten
Peter Otten wrote: >> Both Python 2.4 and 2.5 don't clean up properly here. Why is this? >> Aren't classes supposed to be garbage-collected? > > The reference keeping the classes alive is probably > object.__subclasses__(): > class A(object): pass > ... sum(1 for c in object.__subclass

Re: Return value of an assignment statement?

2008-02-27 Thread Bruno Desthuilliers
Jeff Schwab a écrit : > [EMAIL PROTECTED] wrote: >>> What you can't do (that I really miss) is have a tree of assign-and-test >>> expressions: >>> >>> import re >>> pat = re.compile('some pattern') >>> >>> if m = pat.match(some_string): >>> do_something(m) >>>

Re: How to pass shell variable to shell script from python

2008-02-27 Thread D'Arcy J.M. Cain
On Wed, 27 Feb 2008 15:37:25 +0800 "Rockins Chen" <[EMAIL PROTECTED]> wrote: > Clearly, I made some typing mistake, it's the shbang line! it should be: > #!/usr/bin/python Side topic - if you want portability use the following: #! /usr/bin/env python -- D'Arcy J.M. Cain <[EMAIL PROTECTED]>

Re: BaseHTTPServer and do_POST method

2008-02-27 Thread 7stud
On Feb 27, 5:33 am, rocksportrocker <[EMAIL PROTECTED]> wrote: > Hi, > > I am trying to implement a local server for storing and retrieving > numerical data. > So I use BaseHTTPServer as follows: > > - >     from BaseHTTPServer import * > >  

Re: Return value of an assignment statement?

2008-02-27 Thread Bruno Desthuilliers
Jeff Schwab a écrit : (snip) > This is apparently section 1.9 of the Python Cookbook: > > http://www.oreilly.com/catalog/pythoncook2/toc.html > > Martelli suggests something similar to the "thigamabob" technique I use > (he calls it DataHolder). It's really more like the "xmatch" posted by > P

Re: Getting python docstings

2008-02-27 Thread Rufman
ok...i took a look at epydoc. I can produce html documentation, but when i try to generate a pdf, I get this error: Error: latex failed: File `fancyhdr.sty' not found.latex: Error response from server: 404 my system: - MiKTeX2.7 installed - windows xp - ghostscript 8.60 Thanks for the

Re: first time use of swig, python and c++ .. it's a mess ... please advice

2008-02-27 Thread Hyuga
On Feb 26, 3:38 pm, Eric von Horst <[EMAIL PROTECTED]> wrote: > Hi, > > we have a third-party product that has a C++ api on HP-UX. > > I would like be able to use the API in Python (as I remember Python is > good at doing this). > > I have no experience with this so I Googled and tried to find some

Re: BaseHTTPServer and do_POST method

2008-02-27 Thread rocksportrocker
If I ommit send_response() in do_POST() I get no errormessage. That is an acceptable solution for me. Greetings, Uwe -- http://mail.python.org/mailman/listinfo/python-list

Re: Return value of an assignment statement?

2008-02-27 Thread Bruno Desthuilliers
Paddy a écrit : > On 21 Feb, 23:33, "[EMAIL PROTECTED]" > <[EMAIL PROTECTED]> wrote: >>> What you can't do (that I really miss) is have a tree of assign-and-test >>> expressions: >>> import re >>> pat = re.compile('some pattern') >>> if m = pat.match(some_string): >>>

Re: BaseHTTPServer and do_POST method

2008-02-27 Thread rocksportrocker
On Feb 27, 2:50 pm, 7stud <[EMAIL PROTECTED]> wrote: > ... > I don't get that error. On the server, I get the output: > > POST > localhost - - [27/Feb/2008 06:49:13] "POST / HTTP/1.1" 200 - > > and on the client I get: > > None > In my case the server says: Traceback (most recent call last

Re: Logging to HTTP or File

2008-02-27 Thread D'Arcy J.M. Cain
On Wed, 27 Feb 2008 10:16:33 - "Robert Rawlins - Think Blue" <[EMAIL PROTECTED]> wrote: > How would you manage this? I'm thinking about building my own custom log > handler for the task, which if unable to resolve the webservice will just > log to the file instead, I'm just not sure if there is

MySQL and restore

2008-02-27 Thread Frank Aune
Hi, Inspired from http://blog.spikesource.com/mysql_hotbackup.htm: I restore a database from an SQL dump like this: (...) f= open('test.sql', 'r') sql = f.read() f.close() self.query("""%s""" % sql) (...) This works fine for dumps made with "mysqldump -uroot -B test > test.sql". However, if per

[ANN] pyTenjin 0.6.2 - a fast and full-featured template engine

2008-02-27 Thread makoto kuwata
I have released pyTenjin 0.6.2. http://www.kuwata-lab.com/tenjin/ This is a tiny bug fix release. pyTenjin is the fastest template engine for Python. Not only very fast, but also full-featured and easy-to-use is pyTenjin. You can embed Python statements and expressions into your text file. Tenjin

Re: Why this ref leak?

2008-02-27 Thread Bjoern Schliessmann
Peter Otten wrote: > Bjoern Schliessmann wrote: >> BTW, where is your method sys.gettotalrefcount supposed to come >> from? My CPython doesn't have it. > > It's in the debug build only. Makes sense; thank you. Regards, Björn -- BOFH excuse #292: We ran out of dial tone and we're and waiti

Re: Why this ref leak?

2008-02-27 Thread Duncan Booth
Peter Otten <[EMAIL PROTECTED]> wrote: > Peter Otten wrote: > >>> Both Python 2.4 and 2.5 don't clean up properly here. Why is this? >>> Aren't classes supposed to be garbage-collected? >> >> The reference keeping the classes alive is probably >> object.__subclasses__(): >> > class A(object

XML expat error

2008-02-27 Thread dirkheld
Hi, I have written a piece of code that reads all xml files in a directory in onder to retrieve one element in each of these files. All files have the same XML structure. After file 123 I receive the following error : xml.parsers.expat.ExpatError: not well-formed (invalid token): line 554, column

Re: network programming: how does s.accept() work?

2008-02-27 Thread Grant Edwards
On 2008-02-27, Micah Cowan <[EMAIL PROTECTED]> wrote: > Grant Edwards wrote: >> On 2008-02-26, Micah Cowan <[EMAIL PROTECTED]> wrote: >> >>> 7stud, what you seem to be missing, and what I'm not sure if anyone has >>> clarified for you (I have only skimmed the thread), is that in TCP, >>> connectio

ANN: ConfigObj 4.5.2 and validate 0.3.2

2008-02-27 Thread Fuzzyman
There was a bug in release 4.5.1 of ConfigObj, so there is now an updated release: * `ConfigObj 4.5.2 `_ * `Validate 0.3.2 `_ The bug affected the use of ``None`` as a default value in configspec

Re: Backup Script over ssh

2008-02-27 Thread Christian Kortenhorst
But there is no rsync for windows without using cygwin On 2/26/08, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > > En Thu, 21 Feb 2008 09:32:23 -0200, Christian Kortenhorst > <[EMAIL PROTECTED]> escribió: > > > > I am new to python and the list. > > > Welcome? > > > > I want to create backup scri

Instance of inherited nested class in outer class not allowed?

2008-02-27 Thread mrstephengross
I've got an interesting problem with my class hierarchy. I have an outer class, in which two nested classes are defined: class Outer: class Parent: def __init__ (self): print "parent!" class Child(Parent): def __init__ (self): Outer.Parent.__init__(self) foo = Child() No

Re: Getting python docstings

2008-02-27 Thread grflanagan
On Feb 27, 3:42 pm, Rufman <[EMAIL PROTECTED]> wrote: > ok...i took a look at epydoc. I can produce html documentation, but > when i try to generate a pdf, I get this error: > > Error: latex failed: File `fancyhdr.sty' not found.latex: Error >response from server: 404 > > my system: > - Mi

Re: XML expat error

2008-02-27 Thread Richard Brodie
"dirkheld" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > xml.parsers.expat.ExpatError: not well-formed (invalid token): line > 554, column 20 > > I guess that the element I try to read or the XML(which would be > strange since they have been created with the same code) can't ben

Making string-formatting smarter by handling generators?

2008-02-27 Thread Tim Chase
Is there an easy way to make string-formatting smart enough to gracefully handle iterators/generators? E.g. transform = lambda s: s.upper() pair = ('hello', 'world') print "%s, %s" % pair # works print "%s, %s" % map(transform, pair) # fails with a """ TypeError: not enough argumen

Raising exception on STDIN read

2008-02-27 Thread Michael Goerz
Hi, I would like to raise an exception any time a subprocess tries to read from STDIN: latexprocess = subprocess.Popen( \ 'pdflatex' + " " \ + 'test' + " 2>&1", \ shell=True, \ cwd=os.getcwd(), \ env=os.environ, \ stdin=StdinCatcher() # any

Re: Making string-formatting smarter by handling generators?

2008-02-27 Thread grflanagan
On Feb 27, 5:23 pm, Tim Chase <[EMAIL PROTECTED]> wrote: > Is there an easy way to make string-formatting smart enough to > gracefully handle iterators/generators? E.g. > >transform = lambda s: s.upper() >pair = ('hello', 'world') >print "%s, %s" % pair # works >print "%s, %s" % ma

Re: Raising exception on STDIN read

2008-02-27 Thread Ian Clark
On 2008-02-27, Michael Goerz <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to raise an exception any time a subprocess tries to read > from STDIN: > > latexprocess = subprocess.Popen( \ > 'pdflatex' + " " \ > + 'test' + " 2>&1", \ > shell=True, \ > cwd=os.g

Python's BNF

2008-02-27 Thread MartinRinehart
I spent too long Googling for Python's BNF. Eventually found it at Python.org, but only by accident. I've put Python's BNF here: http://www.martinrinehart.com/articles/python-parse-bnf.html Extensively cross-referenced. Addenda: No, Google, I didn't want the Botswana daily news with its articl

Re: Making string-formatting smarter by handling generators?

2008-02-27 Thread D'Arcy J.M. Cain
On Wed, 27 Feb 2008 10:23:49 -0600 Tim Chase <[EMAIL PROTECTED]> wrote: > I can force it by wrapping the results of my generator in a call > to tuple() or list() I think you are wrong about list(). Since map() returns a list already it doesn't change anything. >print "%s, %s" % tuple(map(tr

Re: Making string-formatting smarter by handling generators?

2008-02-27 Thread Arnaud Delobelle
On Feb 27, 4:23 pm, Tim Chase <[EMAIL PROTECTED]> wrote: > Is there an easy way to make string-formatting smart enough to > gracefully handle iterators/generators?  E.g. > >    transform = lambda s: s.upper() >    pair = ('hello', 'world') >    print "%s, %s" % pair # works >    print "%s, %s" % ma

Re: Python's BNF

2008-02-27 Thread Arnaud Delobelle
On Feb 27, 5:23 pm, [EMAIL PROTECTED] wrote: > I spent too long Googling for Python's BNF. Eventually found it at > Python.org, but only by accident. http://www.google.com/search?q=python+grammar -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list

Re: refreshing the cache time of a key

2008-02-27 Thread Sean Chittenden
>is it possible to refresh the cache time of a key with out having > to retrieving the cached data and storing it back in memcache .. for > example if a data is cached for > 1 hour and at the 50th minute from the time this data has been > cached i want to store it in the cache for 1

Re: refreshing the cache time of a key

2008-02-27 Thread Dustin Sallings
On Feb 27, 2008, at 4:17, bharath venkatesh wrote: >is it possible to refresh the cache time of a key with out having > to retrieving the cached data and storing it back in memcache .. for > example if a data is cached for > 1 hour and at the 50th minute from the time this data has been

how to create eigenface image

2008-02-27 Thread harryos
hi all I am new to python and learning PCA method by reading up Turk&Petland papers etc while trying out PCA on a set of greyscale images using python, and numpy I tried to create eigenvectors and facespace. i have facesarray--- an NXP numpy.ndarray that contains data of images N=numof ima

Re: time.time() strangeness

2008-02-27 Thread Ross Ridge
Nitro <[EMAIL PROTECTED]> wrote: >They should really make the fpu preserve flag the default. It just causes >very sneaky bugs. They did in Direct3D 10, which doesn't change the flags. It's too late to change the behaviour Direct3D 9 which was created a time where changing FPU precision could h

Re: European python developers

2008-02-27 Thread Martin P. Hellwig
[EMAIL PROTECTED] wrote: > Hi Python Enthusiasts, > > I am hoping one or two members of this list might help me locate in Europe > to begin a small team of developers with a focus on python for the central > part of the server development. > > My personal first choice is Spain only because I lik

Re: Instance of inherited nested class in outer class not allowed?

2008-02-27 Thread Diez B. Roggisch
mrstephengross schrieb: > I've got an interesting problem with my class hierarchy. I have an > outer class, in which two nested classes are defined: > > class Outer: > class Parent: > def __init__ (self): > print "parent!" > class Child(Parent): > def __init__ (self): > Out

Re: How about adding rational fraction to Python?

2008-02-27 Thread Ross Ridge
Mark Dickinson <[EMAIL PROTECTED]> wrote: >True division and floor division are different operations. It doesn't >seem ridiculous to use different operators for them. I don't have a problem with there being different operators for integer and floating-point division. I have a problem with the b

Print to end of line in a terminal

2008-02-27 Thread ndlarsen
Hey. This might seem as a arbitrary question to some. Anyway, I'm wondering how I go about printing text to the end of a line in a terminal/console. I've been googling it for a few days without any success. Any suggestions will be greatly appreciated. Regards ndlarsen -- http://mail.python.or

Re: Instance of inherited nested class in outer class not allowed?

2008-02-27 Thread mrstephengross
> class Foo: > foo = Foo() > > You have to live with that. Just do > Outer.foo = Outer.Parent() > after your class-statement to achieve the same result. Hmmm. Well, I see why that works. It's too bad, though. If I want to keep all executed code safely within a "if __name__ == '__main__'" blo

X Windows Problems in 2.5.2

2008-02-27 Thread SwimmingApe
Hi there, first off I'm running MAC OS X 10.4.11 on a Intel MacBook Pro using Apples X11. For a project I am working on I have to start a separate gui (in this case based on the Fox toolkit) as a thread in python. So I have a swig wrapper around some C++ code which starts the thread, creates the w

threading/Queue: join() and task_done() not working? (deadlock)

2008-02-27 Thread Gal Aviel
Hello All, I'm seeing strange behavior where one thread waits on a queue using join() and the later (or so I think, according to order of the printing in STDOUT) another thread calls task_done() on the very same queue, however the first thread does not wake up, it keeps blocking forever. I'm usin

Re: BaseHTTPServer and do_POST method

2008-02-27 Thread Gabriel Genellina
En Wed, 27 Feb 2008 10:33:35 -0200, rocksportrocker <[EMAIL PROTECTED]> escribi�: > Hi, > > I am trying to implement a local server for storing and retrieving > numerical data. > So I use BaseHTTPServer as follows: > > - > from BaseHTTP

Re: Making string-formatting smarter by handling generators?

2008-02-27 Thread Boris Borcic
D'Arcy J.M. Cain wrote: >> I find I hit it mostly with calls to map() where I want to apply >> some transform (as above) to all the items in a list of >> parameters such as >> >>"%s=%s&%s=%s" % map(urllib.quote, params) > > Isn't map() deprecated? The above can be done with; > > "%s=%s

Re: Official IRC channel for Python?

2008-02-27 Thread Paul Rubin
"Guilherme Polo" <[EMAIL PROTECTED]> writes: > > I can join #perl, #php, #ruby, #mysql, #postgres without registration. > > What advantage does it have? and the advantage really worth? > > The direct benefit is a probability of having less spam, and things > like that. I don't remember ever see

Re: threading/Queue: join() and task_done() not working? (deadlock)

2008-02-27 Thread Raymond Hettinger
On Feb 27, 11:06 am, Gal Aviel <[EMAIL PROTECTED]> wrote: > Hello All, > > I'm seeing strange behavior where one thread waits on a queue using join() and > the later (or so I think, according to order of the printing in STDOUT) > another > thread calls task_done() on the very same queue, however t

Re: Instance of inherited nested class in outer class not allowed?

2008-02-27 Thread Gabriel Genellina
En Wed, 27 Feb 2008 16:52:57 -0200, mrstephengross <[EMAIL PROTECTED]> escribi�: >> class Foo: >> foo = Foo() >> >> You have to live with that. Just do >> Outer.foo = Outer.Parent() >> after your class-statement to achieve the same result. > > Hmmm. Well, I see why that works. It's too bad

Re: Fwd: Problem with threads in python????????

2008-02-27 Thread James Matthews
Yes On Wed, Feb 27, 2008 at 3:56 AM, <[EMAIL PROTECTED]> wrote: > On Feb 26, 7:56 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: > > En Tue, 26 Feb 2008 01:46:48 -0200, Manikandan R <[EMAIL PROTECTED]> > > > escribió: > > > > > Hai, > > > > > Is it possible to share a single varia

Re: refreshing the cache time of a key

2008-02-27 Thread Sean Chittenden
>is it possible to refresh the cache time of a key with out having > to retrieving the cached data and storing it back in memcache .. for > example if a data is cached for > 1 hour and at the 50th minute from the time this data has been > cached i want to store it in the cache for 1

Re: Raising exception on STDIN read

2008-02-27 Thread Michael Goerz
Ian Clark wrote, on 02/27/2008 12:06 PM: > On 2008-02-27, Michael Goerz <[EMAIL PROTECTED]> wrote: >> I would like to raise an exception any time a subprocess tries to read >> from STDIN: >> latexprocess = subprocess.Popen( \ >> 'pdflatex' + " " \ >> + 'test' + " 2>&1", \ >>

Re: Making string-formatting smarter by handling generators?

2008-02-27 Thread Gabriel Genellina
En Wed, 27 Feb 2008 14:23:49 -0200, Tim Chase <[EMAIL PROTECTED]> escribi�: > Is there an easy way to make string-formatting smart enough to > gracefully handle iterators/generators? E.g. > >transform = lambda s: s.upper() >pair = ('hello', 'world') >print "%s, %s" % pair # works >

Re: Official IRC channel for Python?

2008-02-27 Thread Guilherme Polo
27 Feb 2008 11:34:54 -0800, Paul Rubin <"http://phr.cx"@nospam.invalid>: > "Guilherme Polo" <[EMAIL PROTECTED]> writes: > > > I can join #perl, #php, #ruby, #mysql, #postgres without registration. > > > What advantage does it have? and the advantage really worth? > > > > > The direct benefit i

Re: Raising exception on STDIN read

2008-02-27 Thread Gabriel Genellina
En Wed, 27 Feb 2008 15:06:36 -0200, Ian Clark <[EMAIL PROTECTED]> escribi�: > On 2008-02-27, Michael Goerz <[EMAIL PROTECTED]> wrote: >> Hi, >> >> I would like to raise an exception any time a subprocess tries to read >> from STDIN: >> >> latexprocess = subprocess.Popen( \ >> 'pdflatex'

Re: Backup Script over ssh

2008-02-27 Thread Gabriel Genellina
En Wed, 27 Feb 2008 13:32:07 -0200, Christian Kortenhorst <[EMAIL PROTECTED]> escribi�: > But there is no rsync for windows without using cygwin That's no big deal; rsync doesn't require tons of libraries, just cygpopt-0.dll and cygwin1.dll. See this page: http://www.brentnorris.net/rsyncnt

Re: Making string-formatting smarter by handling generators?

2008-02-27 Thread Tim Chase
>> Is there an easy way to make string-formatting smart enough to >> gracefully handle iterators/generators? E.g. >> >>transform = lambda s: s.upper() >>pair = ('hello', 'world') >>print "%s, %s" % pair # works >>print "%s, %s" % map(transform, pair) # fails >> >> with a """ >> Typ

RE: first time use of swig, python and c++ .. it's a mess ... please advice

2008-02-27 Thread Bronner, Gregory
The operator= stuff is usually innocuous. The compiler died because it couldn't find 'vector', which is reasonable, since it thought it was compiling a C file. Probably because you swigged the file without the magic "-c++" option -- I'm not sure how distutils passes arguments to swig, but if you

Re: Article of interest: Python pros/cons for the enterprise

2008-02-27 Thread Aahz
In article <[EMAIL PROTECTED]>, Carl Banks <[EMAIL PROTECTED]> wrote: >On Feb 24, 7:03 pm, [EMAIL PROTECTED] (Aahz) wrote: >> In article <[EMAIL PROTECTED]>, >> Jeff Schwab <[EMAIL PROTECTED]> wrote: >>> >>>(3) Garbage collection is at least as desirable a language feature as >>>deterministic des

Re: Tkinter: Missing the last piece of the puzzle

2008-02-27 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > Simon Forman wrote: > > yes! check out > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/464635 > > > > HTH, > > ~Simon > > Thanks, Simon. Looks like that will do it. > > Actually, it looks like that will overdo it. I'll be

Re: macro in python

2008-02-27 Thread Terry Reedy
"Guilherme Polo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | 2008/2/27, bharath venkatesh <[EMAIL PROTECTED]>: | > how to create macro in python for set of instruction that is done | > frequently but too less in number to ignore the overhead of function call You can't in

Re: Raising exception on STDIN read

2008-02-27 Thread Michael Goerz
Gabriel Genellina wrote, on 02/27/2008 03:26 PM: > En Wed, 27 Feb 2008 15:06:36 -0200, Ian Clark <[EMAIL PROTECTED]> > escribi�: > >> On 2008-02-27, Michael Goerz <[EMAIL PROTECTED]> wrote: >>> Hi, >>> >>> I would like to raise an exception any time a subprocess tries to read >>> from STDIN: >>>

Re: Making string-formatting smarter by handling generators?

2008-02-27 Thread Arnaud Delobelle
On Feb 27, 5:25 pm, "D'Arcy J.M. Cain" <[EMAIL PROTECTED]> wrote: > On Wed, 27 Feb 2008 10:23:49 -0600 > > Tim Chase <[EMAIL PROTECTED]> wrote: > > >    "%s=%s&%s=%s" % map(urllib.quote, params) > > Isn't map() deprecated?  The above can be done with; > >     "%s=%s&%s=%s" % tuple([urllib.quote(x)

Re: threading/Queue: join() and task_done() not working? (deadlock)

2008-02-27 Thread 7stud
Gal Aviel wrote: > Hello All, > > I'm seeing strange behavior where one thread waits on a queue using join() and > the later (or so I think, according to order of the printing in STDOUT) > another > thread calls task_done() on the very same queue, What is task_done()? The python docs don't list

anydbm safe for simultaneous writes?

2008-02-27 Thread chris
I need simple data persistence for a cgi application that will be used potentially by multiple clients simultaneously. So I need something that can handle locking among writes. Sqlite probably does this, but I am using Python 2.4.4, which does not include sqlite. The dbm-style modules would prob

Re: Raising exception on STDIN read

2008-02-27 Thread Grant Edwards
On 2008-02-27, Michael Goerz <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to raise an exception any time a subprocess tries to read > from STDIN: > > latexprocess = subprocess.Popen( \ > 'pdflatex' + " " \ > + 'test' + " 2>&1", \ > shell=True, \ > cwd=os.g

  1   2   >