[PyKDE] current file line

Juan Fernando Estrada fernandoe at coordinadora.com
Thu Feb 22 19:08:13 GMT 2007


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 at mats.imk.fraunhofer.de
>> http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
>>     
>
> _______________________________________________
> PyKDE mailing list    PyKDE at 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




More information about the PyQt mailing list