"Hendrik van Rooyen" wrote:
> Similarly discrete background thread jobs can be used
> in a functional style this way:
> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/491280
> ( an alternative for the laborious OO-centric threading.
With the various options available, many of which I
# ldconfig -p | grep "/usr/local/lib"
libtk8.4.so (libc6)
=> /usr/local/lib/libtk8.4.so
libtcl8.4.so (libc6) =>
/usr/local/lib/libtcl8.4.so
Sorin
Now that's room service! Choose from over 150,
Gabriel Genellina wrote:
> see this article by M. Simoniato
> http://www.phyast.pitt.edu/~micheles/python/documentation.html for a better
> way using its decorator factory.
Actually the name is Simionato ;)
I have just released version 2.0, the new thing is an update_wrapper
function similar to th
"John" <[EMAIL PROTECTED]> writes:
> Damn! That is bad news. So even if caclulate is independent for
> (i,j) and is computable on separate CPUs (parts of it are CPU bound,
> parts are IO bound) python cant take advantage of this?
Not at the moment, unless you write C extensions that release the
gl
John wrote:
> Thanks. Does it matter if I call shell commands os.system...etc in
> calculate?
>
> Thanks,
> --j
The os.system command neglects important changes in the environment
(redirected streams) and would not work with current version of ppsmp.
Although there is a very simple workaround:
pri
"Tim Peters" <[EMAIL PROTECTED]> wrote:
> [Nick Maclaren]
> >> ...
> >> Yes, but that wasn't their point. It was that in (say) iterative
> >> algorithms, the error builds up by a factor of the base at every
> >> step. If it wasn't for the fact that errors build up, almost all
> >> programs coul
In article <[EMAIL PROTECTED]>,
"Hendrik van Rooyen" <[EMAIL PROTECTED]> writes:
|> "Tim Peters" <[EMAIL PROTECTED]> wrote:
|>
|> > What you will still see stated is variations on Kahan's telegraphic
|> > "binary is better than any other radix for error analysis (but not very
|> > much)", list
In article <[EMAIL PROTECTED]>,
"Hendrik van Rooyen" <[EMAIL PROTECTED]> writes:
|> >
|> I would suspect that this is one of those questions which are simple
|> to ask, but horribly difficult to answer - I mean - if the hardware has
|> thrown it away, how do you study it - you need somehow two
|
In article <[EMAIL PROTECTED]>,
"Hendrik van Rooyen" <[EMAIL PROTECTED]> writes:
|>
|> > Financial calculations need decimal FIXED-point, with a precisely
|> > specified precision. It is claimed that decimal FLOATING-point
|> > helps with providing that, but that claim is extremely dubious.
|> >
In article <[EMAIL PROTECTED]>,
"Hendrik van Rooyen" <[EMAIL PROTECTED]> writes:
|>
|> Ok I will throw in a skewed ball at this point - use integer arithmetic,
|> and work in tenths of cents or pennies or whatever, and don't be too
|> lazy to do your own print formatting...
If anyone is interes
Gabriel Genellina wrote:
[snip]
> As said in the beginning, there is no use for decorators as methods (perhaps
> someone can find a use case?)
Except, perhaps to indicate to the script reader that the decorator only
applies within the class?
Colin W.
> If you move the example above inside the cl
Introduction
Spiff Guard is a library for implementing access lists in Python. It
provides a clean and simple API and was implemented with performance
and security in mind. It was originally inspired by phpGACL
(http://phpgacl.sourceforge.net/), but features an API that is
significantl
[EMAIL PROTECTED] wrote:
> Scott David Daniels wrote:
>> Gabriel Genellina wrote:
>> >... So `callback` should return a function, like this:
>> >
>> > def callback(text):
>> > def handler(event):
>> > print text
>> >
>>
>> Even better than that:
>> def callback(text):
>> def ha
jairodsl wrote:
> Hi,
>
> How can I find the minus element greater than zero in a matrix, my
> matrix is
>
> matrix=
> [9,8,12,15],
> [0,11,15,18],
> [0,0,10,13],
> [0,0,0,5]
>
> I dont want to use "min" function because each element in the matrix is
> associated to (X,Y) position.
>
> Thanks a
>
>
> $title
>
>
> #if user
> hello $user/name
> #else
> hello guest
> #endif
>
>
This example code would work in cheetah with only 2 changes...
www.cheetahtemplate.org
Pete
--
http://mail.python.org/mailman/listinfo/python-list
John> Damn! That is bad news. So even if caclulate is independent for
John> (i,j) and is computable on separate CPUs (parts of it are CPU
John> bound, parts are IO bound) python cant take advantage of this?
It will help if parts are I/O bound, presuming the threads which block
release
John wrote:
> I want to do something like this:
>
> for i = 1 in range(0,N):
> for j = 1 in range(0,N):
>D[i][j] = calculate(i,j)
>
> I would like to now do this using a fixed number of threads, say 10
> threads.
Why do you want to run this in 10 threads? Do you have 10 CPUs?
If you are con
"Colin J. Williams" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> Gabriel Genellina wrote:
>> As said in the beginning, there is no use for decorators as methods
>> (perhaps
>> someone can find a use case?)
> Except, perhaps to indicate to the script reader that the decorat
"Michele Simionato" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> Gabriel Genellina wrote:
>> see this article by M. Simoniato
>> http://www.phyast.pitt.edu/~micheles/python/documentation.html for a
>> better
>> way using its decorator factory.
>
> Actually the name is Simio
Thanks so much for your reply. You've definitely helped me a great
deal on this. Your comment about the difference between define time and
instantiation time cleared things up more than anything, and that also
helped clear up the confusion I was having about "self".
I think the places I've seen d
Wow. Really neat stuff there. memoize seems especially cool since you
can get lots of nice dynamic programming benefits "for free" (sorry if
I just stated the obvious, but I thought was was especially cool.)
Michele Simionato wrote:
> Gabriel Genellina wrote:
> > see this article by M. Simoniato
<[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> button[num] = Tkinter.Button(frame,text = returnstring,
> command=callback(returnstring))#
>
> I understand this part of it
>
> def callback(text):
> def handler(event):
> print text
> It stopped calling it automaticaly b
Thank you so much. Your solution works! I greatly appreciate your
help.
sturlamolden wrote:
> oyekomova wrote:
>
> > Thanks for your note. I have 1Gig of RAM. Also, Matlab has no problem
> > in reading the file into memory. I am just running Istvan's code that
> > was posted earlier.
>
> You h
[EMAIL PROTECTED] wrote:
>
> There is a module in development (processing.py) that provides an API like
> the threading module but that uses processes under the covers:
>
> http://mail.python.org/pipermail/python-dev/2006-October/069297.html
>
> You might find that an interesting alternative.
I'm trying to create a recursive function to evaluate the expressions
within a list. The function uses eval() to evaluate the list. Like a
lisp interpreter but very limited.
What I'm looking for is a function to recursively traverse the list and
provide answers in place of lists, so that ...
E
[EMAIL PROTECTED] wrote:
> Can I get whole commandline not only argument list.
>
> 1. When I command like this
> $ a.py > filename
> 2. sys.argv is returns only argument list
> ['a.py']
>
> Is there a way to find out 'redirection' information.
It's not possible to find the exact command li
First possible raw solution:
from operator import add, sub, mul, div, neg
def evaluate(expr):
if isinstance(expr, list):
fun, ops = expr[0], expr[1:]
return fun(*map(evaluate, ops))
else:
return expr
example = [add, [add, [sub, 5, 4], [mul, 3, 2]], [neg, 5]]
print
Here's an example of a problem that I've recently come up against for
the umpteenth time. It's not difficult to solve, but my previous
solutions have never seemed quite right, so I'm writing to ask whether
others have encountered this problem, and if so what solutions they've
come up with.
Suppos
hi...
is there a way to have a test python app, get its' own processID. i'm
creating a test python script under linux, and was wondering if this is
possible..
also, i've tried using an irc client to join the irc #python channel, and
for some reason i keep getting the err msg saying that the 'addr
On Sun, 14 Jan 2007 16:36:58 -0800, bruce <[EMAIL PROTECTED]> wrote:
>hi...
>
>is there a way to have a test python app, get its' own processID. i'm
>creating a test python script under linux, and was wondering if this is
>possible..
See the os module, the getpid function.
>
>also, i've tried usi
Mark wrote:
[a lot of valid, but long concerns about types that return
an object of their own type from some of their methods]
I think that the best solution is to use an alternative constructor
in your arithmetic methods. That way users don't have to learn about
two different factories for the
"Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote:
>"Nick Maclaren" <[EMAIL PROTECTED]> wrote:
>
>> What I don't know is how much precision this approximation loses when
>> used in real applications, and I have never found anyone else who has
>> much of a clue, either.
>>
>I would suspect that this
Hello,
I find myself in the, for me, unusual (and at the moment unique)
position of having to write a web application. I have quite a lot of
existing Python code that will form part of the business logic. This
relies on 3rd party libraries (such as numpy) which would make porting
to e.g. Iro
Robert Hicks wrote:
> I would get "Core Python Programming" by Wesley Chun. It covers just
> about everything under the sun and includes version 2.5.
Robert, thanks for the plug. if the OP wants to learn more about my
book and its philosophy, feel free to check out my comments on the
Amazon prod
At Sunday 14/1/2007 20:32, [EMAIL PROTECTED] wrote:
Of course, none of this really has anything to do with rational
numbers. There must be many examples of classes for which internal
calls to __init__, from other methods of the same class, require
minimal argument processing, while external cal
How naive (in the sense that compiler people use the term)
is the current Python system? For example:
def foo() :
s = "This is a test"
return(s)
s2 = foo()
How many times does the string get copied?
Or, for example:
s1 = "Test1"
s2
On Sun, 14 Jan 2007 15:32:35 -0800, dickinsm wrote:
> Suppose you're writing a class "Rational" for rational numbers. The
> __init__ function of such a class has two quite different roles to
> play. First, it's supposed to allow users of the class to create
> Rational instances; in this role, __
Operating system: Win XP
Version of Python: 2.4
I recognize that this question is not about Python...it has only a
tangential Python connection. I'm using a Python package to run a
process; that process is issuing an error, and I'm hoping that someone
on this site can point me to the site that ha
On Mon, 15 Jan 2007 14:43:55 +1100, Steven D'Aprano wrote:
>> Of course, none of this really has anything to do with rational
>> numbers. There must be many examples of classes for which internal
>> calls to __init__, from other methods of the same class, require
>> minimal argument processing, w
John> How naive (in the sense that compiler people use the term) is the
John> current Python system? For example:
John> def foo() :
John> s = "This is a test"
John> return(s)
John> s2 = foo()
John> How many times does the string ge
In article <[EMAIL PROTECTED]>,
John Nagle <[EMAIL PROTECTED]> wrote:
> How naive (in the sense that compiler people use the term)
> is the current Python system? For example:
>
> def foo() :
> s = "This is a test"
> return(s)
>
> s2 = foo()
>
> How many times d
On Mon, 15 Jan 2007 03:25:01 +, John Nagle wrote:
> How naive (in the sense that compiler people use the term)
> is the current Python system? For example:
>
> def foo() :
> s = "This is a test"
> return(s)
>
> s2 = foo()
>
> How many times does the s
Hi Paul,
Since your reply I try to use pywinauto. I was able to get the control
of a window that is a good news but it is not working for sub window
this main window create.(popup windows)
eg) File -> printwill open print window but the code is not
clicking print button. I try several combinati
Hi Paul,
Since your reply I try to use pywinauto. I was able to get the control
of a window that is a good news but it is not working for sub window
this main window create.(popup windows)
eg) File -> printwill open print window but the code is not
clicking print button. I try several combinati
"Dennis Lee Bieber" <[EMAIL PROTECTED]>wrote:
> On Sun, 14 Jan 2007 07:18:11 +0200, "Hendrik van Rooyen"
> <[EMAIL PROTECTED]> declaimed the following in comp.lang.python:
>
> >
> > I recall an SF character known as "Slipstick Libby",
> > who was supposed to be a Genius - but I forget
> > the s
Hi,
I want to get all classes of a module in a list. I wrote this code but I
wonder
if there's not a simpler solution
import inspect
def getClassList(aModule):
return [getattr(aModule, attName) \
for attName in aModule.__dict__ \
if inspect.isclass(getattr(aModule,
46 matches
Mail list logo