Erythromycin is a macrolide that inhibits the synthesis of critical proteins of bacteria, binding to the ribosomal RNA and preventing the translocation of tRNA from the ribosome complex. This suppresses their growth (an action called bacteriostatic) and can also lead to bacterial death. Since rRNA and tRNA are common across all bacteria, even the E. coli will be affected.