Well, to get your initial count with a language like C++, I'd just do the most simple thing possible:
grep -c ";" *.h *.cpp
There are sexier ways, and you can argue that it undercounts some stuff and overcounts some stuff, but SLOC is a dumb metric anyway, so spending any more time on it than nessecary is really a waste.
Now to covert to Python? Well, if we are talking a mechanical port, then I'd say use the C++ number. If you are talking a total recoding, then I'd multiply by an expressiveness factor. Wikipedia has a nice expressiveness chart for this. Again, the numbers are debateable, but debating isn't worth the effort. If we divide C++'s 2.5 by Python's 6, we get 0.416(6 repeating). So multiply that number by the total you got from your grep
, and you have your number.
Now, Let me take a moment to say that reimplementing working software in another language for no other reason than to switch languages is a really Dumb Idea. At best, if nothing goes wrong, you will have essentially just the program you started with. More likely you will have a ton of debugging work to slog through just to get back to where you were before.