Sinardy Xing wrote:

> following is my main app
> 
> -- start here--
> from loggingme import logme
> 
> def say_hello(name, age):
>         print('Hello {}, I am {}'.format(name, age))
> 
> #say_hello=logme(say_hello('Sinardy'))
> @logme
> say_hello('Tonny', 8)

Isn't this a SyntaxError? You can decorate functions, not function calls:

When Python finds a syntax error in your main script it won't proceed to run 
it and thus the bugs in modules that would be imported if the code were 
executed don't matter at this point.

Try

@logme
def say_hello(name, age):
        print('Hello {}, I am {}'.format(name, age))

say_hello('Tonny', 8)


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to