Where to put the import command in the file?

wang frank fw3 at hotmail.co.jp
Tue Oct 2 18:01:27 EDT 2007


Hi,
 
I am writing Python script now. The project will grow bigger in future. I need to import some packages for several functions, such as numpy. Where is the best plalce to put the import numpy command? Is it fine to put on the first line in the file? Is it better to put it into each function after the def functionname? or they are the same. Since numpy function will be used in all files, so I have to import it in each files. Does this will increase the memory usuage or there are better way to do it.
 
thanks
 
Frank
_________________________________________________________________
広告表示なし!アカウント有効期限なし!Hotmail Plus のお申し込みはこちら
http://get.live.com/mail/options
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20071002/b4533e4d/attachment.html>


More information about the Python-list mailing list