all
method bodies of class FooBar, not only Foo. When ran through a debugger, it
iterates both methods. What I really wanted to do, was to replace only one
method (Foo) and leave the other untouched.
I hope this was understandable conveyed.
Answers are highly appreciated.
Regards,
Ronny
(the same
person who wrote ast) and it uses ast to generate python code from the AST.
Thanks!
Regards,
Ronny Mandal
import ast
class FindAndTransform(ast.NodeTransformer):
def visit_FunctionDef(self, node):
if node.name == 'Foo':
node = ast.parse
Hi!
Assume we have a list l, containing tuples t1,t2...
i.e. l = [(2,3),(3,2),(6,5)]
And now I want to sort l reverse by the second element in the tuple,
i.e the result should ideally be:
l = [(6,5),(2,3),(3,2)]
Any ideas of how to accomplish this?
Thanks,
Ronny Mandal
--
http
Uhm, thanks. (I've used lambda-sort earlier, but quite forgot..)
:)
On 18 May 2006 12:38:55 -0700, Paul Rubin
http://[EMAIL PROTECTED] wrote:
Ronny Mandal [EMAIL PROTECTED] writes:
And now I want to sort l reverse by the second element in the tuple,
i.e the result should ideally be:
l
no attribute '_listbox_1'
i.e., it cannot find the listbox! Strange, both files is in the same
folder. What is wrong here?
Thanks,
Ronny Mandal
--
http://mail.python.org/mailman/listinfo/python-list
Thanks, but the problem was my undentation, after making one indent,
it worked as expected. :)
-Ronny M
--
http://mail.python.org/mailman/listinfo/python-list
On 9 May 2006 10:05:48 -0700, [EMAIL PROTECTED] wrote:
I am a newbie to Python. I want to call python functions from C. I
looked for examples but I couldn't get any simple one. Lets say my
python code is :
def add(a,b)
return (a+b)
I want to call add from C. Could anybody please help me?
Hello.
I need to draw a graph, with letters on the x-axis and a numeric value
on the y-axis, e.g.. a = 3, b = 6 etc.
Suggestions?
Thanks,
Ronny Mandal
--
http://mail.python.org/mailman/listinfo/python-list
Is there a way of checking whether the call to a set-function is
called from within the class, e.g. the __init__() contra
object.set()?
Thanks.
Ronny Mandal
--
http://mail.python.org/mailman/listinfo/python-list
Assume you have a mathematical function, e.g. f(x) = x + 4
To calculate all the values from 1 to n, a loop is one alternative.
But to make this function work with vectors instead i.e
f(x_vector) = result_vector,
how should the function then be implemented?
Thanks
RM
--
Support bacteria -
Can someone please explain or point me to articles regarding these two
methods?
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
to 4.2
Thanks and regards,
Ronny Mandal
--
http://mail.python.org/mailman/listinfo/python-list
12 matches
Mail list logo