[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyKDE] current file line
From:       Juan Fernando Estrada <fernandoe () coordinadora ! com>
Date:       2007-02-22 19:08:13
Message-ID: 45DDEA1D.1050003 () coordinadora ! com
[Download RAW message or body]

Paul Giannaros escribió:
> On Thursday 22 February 2007 18:53, Juan Fernando Estrada wrote:
>   
>> hello
>>
>> how i can get current file line in the same form of __name__ ....
>> __line__ ???
>>
>>     
>
> sys._getframe().f_lineno
>
> The nice thing about getframe is that you can also peek further back and get 
> more information about the point from which your function was called (locals 
> that reside there, the name of the function, the line on which you were 
> called).
>
>   
>> _______________________________________________
>> PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
>> http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
>>     
>
> _______________________________________________
> PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
> http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
>
>   
this is the final solution thank's Paul

def __line__():
  return sys._getframe(1).f_lineno

_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic