Julia's equivalent of Python's importlib.import_module(path)

@patrick-kidger ahah! Thanks! I knew there must have been some way to do it that I did not know.

Ok, here’s the new code using that syntax. I also switched requested_plugins from plugin names to plugin paths, to make it more similar to my original Python code

using FromFile: @from

plugins = []
map(requested_plugins) do plugin_path
    plugin_name = splitext(splitdir(plugin_path)[2])[1]
    plugin = Symbol(plugin_name)
    @eval @from $plugin_path import $plugin
    @eval $plugin.activate()
    push!(plugins, plugin)
end
1 Like