Use Python for sed like shell one-liners.