I would like to batch check my imports to find out if there is broken or missed matched imports.
the "import ("%s" % X)" did not work.
PIP_adds is a list of 25 imports that I would like to know if they are there and if not run my def.
What is the magic code for the 4th line down?
Code: Select all
try:
for X in PIP_adds:
try:
import ("%s" % X)
except ImportError:
print(X + ' Did not import')
""" dif to load file goes here """
except KeyboardInterrupt:
pass