Python by Swaroop C H - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

The from..import statement

If you want to directly import the argv variable into your program (to avoid typing thesys. everytime for it), then you can use thefrom sys import argv statement. If you want to import all the names used in thesys module, then you can use thefrom sys import * statement. This works for any module. In general, avoid using thefrom..import statement and use theimport statement instead since your program will be much more readable and will avoid any name clashes that way.