Recalling import in module

Posted by Isaiah on Stack Overflow See other posts from Stack Overflow or by Isaiah
Published on 2010-05-29T17:47:40Z Indexed on 2010/05/29 17:52 UTC
Read the original article Hit count: 213

Filed under:
|
|

I'm still learning python and after playing around with pygame I noticed I'm re-importing things in modules I'm importing that I've already imported.

import pygame

For instance I have some classes in a separate file, but I must also import pygame into that file too for them to work. Does it actually import the code twice? Will it slow down my program? Or does it just pull the same import from before, but if it does that, why would I need to import it?

Is there anything like (load) in lisp that just pulls in the code like it is part of the main file?

Thank You

© Stack Overflow or respective owner

Related posts about python

Related posts about pygame