"Rob Cherry" <pythontu...@lxrb.com> wrote

Extending on this advice somewhat - is it *ever* correct to "import foobar".

Yes, it is *usually* correct to "import foobar" and rarely correct to "from foobar".
The exception being if you only need one or two names from foobar, but
usually you need a lot more, in which case use import foobar.

To save typing you can give foobar a shorter name:

import foobar as fb

For some reason that convenience feature doesn't get mentioned
all that often but I use it a lot.

HTH,


--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to