I was wondering...
It's possible to do it?
A simple console command based program that shows how are your FPS, for your currently running game/program?
Short answer: Yes.
Long answer: Beside that it is much simpler to gather statistics when you have hooks inside the measured program, it is possible also to hook on lower level: directly to DirectX or OpenGL. Start your discovery from some existing posts. They are in C++ but that's another deal: you can use SWIG to interop between Python and C/C++.
As a proof. There is famous Fraps applications that does what you say.