Jay Taylor's notes

back to listing index

Grabbing the current line number easily « Python recipes « ActiveState Code

[web search]
Original source (code.activestate.com)
Tags: programming python code.activestate.com
Clipped on: 2012-10-26

Grabbing the current line number easily (Python recipe)

1

This snippet of code allows us to grab the current line number easily, and demonstrates the power of the 'inspect' module for introspective Python programs.

Python, 17 lines
Image (Asset 1/4) alt=

for more information about the introspective 'inspect' module.

Add a comment

Sign in to comment