Question: Demo:

```
from module1 import func1
from module1 import func2

```

Ques:
Is the module1 executed twice?
Is this the good and correct way to import?
Thx!

Answer: 
In `SO2.py`:

```
print 'SO2 is running'
a = 'cabbage'
b = 'python-is-awesome'

```

In `SO.py`:

```
from SO2 import a
from SO2 import b

```

When running the latter:

```
SO2 is running

```

Only once ;).

---

Per [PEP 8](http://www.python.org/dev/peps/pep-0008/#imports), it's *okay* to do:

```
from SO2 import a, b

```
More generally, Python only loads a module once, the first time that it is needed--whether it's an "import form" or plain import statement that does the "needing". Any subsequent imports will just note that the module has already been loaded.

The module initialization is only done once, on load.

If you need to refresh the contents of a module, you can reload it. On Python 2, there's a reload(m) built-in function to reload module m. In Python 3 this has been moved to the imp module, and imp.reload(m). In Python 3.4, imp is being deprecated in favor of a new module (as of 3.1) named "importlib". The initialization will get run again when a module is reloaded.

See: 

* <http://docs.python.org/2.7/library/functions.html#reload>
* <http://docs.python.org/3.3/library/imp.html>
* <http://docs.python.org/3.3/library/importlib.html#module-importlib>

As far as "best practices" go, I'm not always "pythonic". I agree with the PEP 8 position on one module per import line, but would prefer that modules be also listed alphabetically. 

I don't especially like "import from" statements. If module.func1 is going to be used a lot in some particular function in the current source, I prefer adding:

```
def myfunc(*a, **k): 
    func1 = module.func1
    ... etc.

```

...so it's clear that *in that function only* that `func1` means `module.func1`.