I do not know whether that was a good example to show the benefits of the semicolon:
x, y, z = 0, [], None x, y, z = 0, [], None import sys; sys.exit()
import pdb; pdb.set_trace()
import cgitb; cgitb.enable()
import psyco; psyco.full()
import pygtk; pygtk.require('2.0')
And of course it's pretty useful in environments where one-liner are easier to handle: $ python -c "import mymod; mymod.test()" import matplotlib; matplotlib.use('Agg'); from matplotlib import pyplot