Is it possible to format the input from the serial monitor?

Out of interest, have you managed to do that using Python code hard coded into the sketch ?