method decorators and more on decorators

2008-07-27 Thread Themistoklis Bourdenas
Hi, is there any possible way to get the class or class name inside a method decorator? For example in the code sample below: def decorate(func): print type(func) return func class myclass: @decorate def foo(self): pass The output of this program will be the type of the supplied fun

Failing in a simple embedding example of python

2006-03-01 Thread Themistoklis Bourdenas
Hi I'm trying the following simple test in my application: FILE* fp = fopen("test.py", "r"); PyRun_SimpleFile(fp, "test.py"); fclose(fp); However I get seg fault is in PyRun_SimpleFile(fp, "test.py"). "test.py" is an existing file with a simple statement (print 7+4). Whe