3 ms·
While the semicolon is only a convenience it has some common use cases. For example shoot-and-forget invokations of third party modules: import sys; sys.exit
by lehmannro 18y ago
While the semicolon is only a convenience it has some common use cases. For example shoot-and-forget invokations of third party modules:
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()"
- gaius 18y agoNow that I look in my code I actually have: import matplotlib; matplotlib.use('Agg'); from matplotlib import pyplot