Assuming that python is in interactive mode, how do get the text of the command that the user has just entered? For example, say that I set a trace function. I find the frame's code object, look at co_filename and find that it is <stdin>. But I want to know what the actual command was. Is there anyway to do this (in C or Python)? Thanks, Tom.