First, you need to encode your audio stream. You need to run this stream in real-time, and it needs to have a constant sample rate. It isn't enough to just pipe MP3 files through... they can have ID3 tags which may break the stream, and they might be at different sample rates. It's also ideal to have a constant bitrate for internet streaming (but this is not required for the stream to work).
In the end, you'll basically have one big never-ending MP3 file that is created at the same rate it will be played back.
Next, you simply need to make an HTTP PUT to the Icecast server. See this question: Is there any way to do HTTP PUT in python
Icecast uses basic auth, generally.
If you want to make this easier on yourself (albeit with less control), shell out to FFmpeg:
ffmpeg -re -i [some playlist] -f mp3 -method PUT http://example.com/some-stream
(where example.com
is your Icecast server)