How close was your face to the glass? A possibility is that if you were close enough and you were "talking" to him .... The hot air from your breath as you were speaking created a "hot spot" on the glass, for example when we blow hot air on a cold window so you can write on it with your finger .... Even tho you could not see the fog, ball pythons use their heat receptors to hone in on prey. I'm thinking that your breath warmed a small area on the glass that he could pick up on with his receptors and he was focused on that "hot spot" ..... Was he flicking his tounge a lot?? This is just a theory that popped in my head, but I don't think it is too far fetched to be a possibility