3 ms·
This looks like a really useful tool, although the automatic importing of anything that smells like a module makes me a little uncomfortable: modules = re.
by blahpro 14y ago
This looks like a really useful tool, although the automatic importing of anything that smells like a module makes me a little uncomfortable:
modules = re.findall(r'([\w.]+)+(?=\.\w+)\b', all_text)
then later:
for m in modules:
try:
key = m.split('.')[0]
self[key] = __import__(m)
except:
pass