How do I upload binary files using Python?

Alternatively, is there a way to upload binary files using CURL?