How to import all imports of another .py file
Question: ### Info

  * python version: 3
  * development environment: eclipse luna

### Goal

I'm currently developing an addon system for a program. My Idea was to create
a file where I import all addons. This file is generated during the addon
instalation process (when you click the button: install addon). It looks like
that:

    
    
    import testaddon1
    import testaddon2
    import bigaddon.startup as bigaddon
    

When I start my programm I want to import all files/modules to read some
properties and automaticly implement the addons in my program.

### Question

How can I start import statements that are written in a different file.

file1.py

    
    
    def test():
       print('test')
    

file2.py

    
    
    import file1.py.test as test
    

file3.py

    
    
    #run the import commands from file2.py
    test()
    

console output after running file3.py:

    
    
    test
    

### What I want

  * an answer on how to achieve the previous result
  * a different idea on how to create an addon system


Answer: Yes you can do it.

file.py

    
    
    def hello():
        print('hello')
    

file2.py

    
    
    import file
    
    file.hello()
    

file3.py

    
    
    from file2 import *
    
    file.hello()
    

executing file 3. `greg@ja python file3.py`

