A useful print for debugging in C++ is
std::cout << __LINE__ << std::endl;
Of course you can simply print a string with the line number, for example:
std::cout << "this is line 54" << std::endl;
but it won't keep changing the line number when you move it around. Is there any equivalent macro in Python?