You should "call" the function used as argument in "temp" (named val), just
if you're calling directly "hello". This way:
def hello():
print 'hello'
return
def temp(val):
val() # Note the brackets, as you're executing the function
return
temp(hello)
I think this is what you are trying to achieve...
Best regards,
Jaime Buelta
On Thu, Apr 8, 2010 at 12:43 PM, anish thomas <[email protected]>wrote:
> Hi Experts,
>
> Not sure , I am contacting the right alias for some clarifications on
> python.
> Am beginer and looking for your comments/suggestions on implementing call
> backs in python.
> I have the following sample code, where I am trying to execute "hello"
> using callbacks,but its not printing the value.
> Can someone please comment on it
>
> Regards
> Anish
>
>
> def hello():
> print 'hello'
> return
> def temp(val):
> val
> return
> temp(hello)
>
>
>
>
> ------------------------------
> Invest your money wisely post Budget Sign up
> now.<http://news.in.msn.com/moneyspecial/>
>
> _______________________________________________
> python-uk mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/python-uk
>
>
_______________________________________________
python-uk mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-uk