Python import path containing reserved keyword

Import a module from a path containing a reserved keyword like "is".

This import statement fails because the word "is" is a reserved in python.

from import resources

Use importlib to import.

import importlib
mymodule = importlib.import_module('')
Did this help you? Please let me know with a comment. Thank you
Posted .

Comments (RSS)

Leave a comment