It is possible to access this command history?

Can i somehow get access to the command history, i just want to check out if making an simple interactive tutorials via python might be possible.

Can someone give me an hint where to look?