call function from list(string) in another py file
Question: i have 3 python scripts ('testPrint01.py','testPrint02.py','testPrint03.py')
and i would like to call function from 'testPrint02'

    
    
        import sys
        sys.path.append(path)
    
        a = ['testPrint01','testPrint02','testPrint03']
        import sys.a[1]
        a[1].justPrintIt()
    

thank you


Answer: If you're in the same directory as your target script you can use

    
    
    from testPrint02 import x
    

Where x is the function you want to import.

**Edit** : To import a module from a string variable you can use `importlib`
as described here: [import module from string
variable](http://stackoverflow.com/questions/8718885/import-module-from-
string-variable)

