Question: So this may sound weird to you. Say I have two files, `module.py` and `script.py`.

Here is what they may look like:

**module.py**

```
import time
print(time.time())

```

**script.py**

```
from module import *
time.sleep(0.1)  # Still works as time is imported in the module imported

```

How can I avoid this from happening?

If there is a duplicate question like this, let me know.

Answer: 
The easiest answer is to avoid using `from module import *`. It really isn't worth it anywhere other than the interactive prompt.

The next answer is to put an [`__all__`](https://docs.python.org/2/tutorial/modules.html#importing-from-a-package) in `module.py`. `__all__` should be a list of strings. The strings should be the names of things that you want to export. For example:

### module.py

```
import time

__all__ = ['MyClass', 'my_func']

class MyClass():
    pass

def my_func():
    pass

```
When importing, you can use functions. Basically, functions within functions, but you can also import inside the functions.

```
def init():
    import time
    def innerFunc():
        time.sleep(.2)
    time.sleep(.1)
    innerFunc()
init()

```