Please help me with what is happening

I caught my Ball Python sounding like it was farting wet farts for about 30 seconds and curling up. And looking at me like it was in desperation and mouth open. Does anyone have a clue? It eats live regularly, poops, light types and heat / temps and humidity is good. Did I just catch it pooping or something or is something seriously wrong?