You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
312 B
23 lines
312 B
8 years ago
|
#!/usr/bin/python
|
||
|
# -*- coding: UTF-8 -*-
|
||
|
|
||
|
def load(name):
|
||
|
try:
|
||
|
obj = __import__(name)
|
||
|
return obj
|
||
|
except:
|
||
|
pass
|
||
|
|
||
|
try:
|
||
|
import importlib
|
||
|
obj = importlib.__import__(name)
|
||
|
return obj
|
||
|
except:
|
||
|
pass
|
||
|
|
||
|
def loads(namelist):
|
||
|
for name in namelist:
|
||
|
obj = load(name)
|
||
|
if obj is not None:
|
||
|
return obj
|